calling StoredProcedure by returnvalue output

发表于:2007-06-07来源:作者:点击数: 标签:
ALTER PROCEDURE sp_JudgeWhetherAvailable( @Date1 varchar(20), @Date2 varchar(20), @EmployID varchar(4), @LeaveType varchar(4), @ReturnValue float OUTPUT ) AS set @ReturnValue=dbo.JudgeWhetherAvailable(@Date1,@Date2,@EmployID,@LeaveType) --

ALTER   PROCEDURE sp_JudgeWhetherAvailable(
@Date1 varchar(20),
@Date2 varchar(20),
@EmployID varchar(4),
@LeaveType varchar(4),

@ReturnValue float OUTPUT

) AS


set @ReturnValue= dbo.JudgeWhetherAvailable(@Date1,@Date2,@EmployID,@LeaveType)

----------------------------------------------------------------------------------------------------------

Set adoCmd.ActiveConnection = adoConn
adoCmd.CommandText = "sp_JudgeWhetherAvailable"
const adCmdStoredProc = 4
adoCmd.CommandType = adCmdStoredProc
adoCmd.Parameters.Refresh
response.write Date1 & "
"
response.write Date2 & "
"
response.write EmployID & "
"
response.write LeaveType & "
"

adoCmd.Parameters(1)= Date1
adoCmd.Parameters(2)= Date2
adoCmd.Parameters(3)= EmployID
adoCmd.Parameters(4)= LeaveType
'
set rs=adoCmd.Execute
response.write adoCmd.Parameters(5)

--------------------------------------------------------------------

on Query analyzer

declare @ReturnValue float
EXEC sp_JudgeWhetherAvailable2 '2005/07/17 08:00','2005/07/20 15:00','1947','S',@ReturnValue = @ReturnValue output
select @ReturnValue

原文转自:http://www.ltesting.net