日期:2014-05-17 浏览次数:20607 次
IF OBJECT_ID('dbo.IF_Aggregate_Common_SP','p') IS NOT NULL
DROP PROC dbo.IF_Aggregate_Common_SP
GO
CREATE PROCEDURE dbo.IF_Aggregate_Common_SP
(@chrIFCode char(1) ,@chrAccountType char(1) ,@chrDataDiv char(1))
AS
BEGIN
DECLARE @intRTNCD integer
DECLARE @chrMSG char(100)
SET @intRTNCD = 0
SET @chrMSG = ''
…… --此处处理内容省略
SELECT @intRTNCD AS RTNCD, @chrMSG AS MSG
END
create proc t1
@a int,
@result int out
as
select @result=@a
return
--调用且取结果
declare @l int
exec t1 1,@l out
select @l
if OBJECT_ID('t1') is not null drop proc t1
go
create proc t1
@a int,
@result int out, --第一个返回值
@result1 int out --第二个返回值
as
select @result=@a
select @result1=@a+1
return
--调用且取结果
declare @l int,@l1 int
exec t1 1,@l out,@l1 out
select @l,@l1
create proc testProc2
@t3 char(1) output,
@t4 char(1) output,
@t5 char(1)
as
select @t3=@t5
select @t4='a'
declare @result1 char(1)
declare @result2 char(1)
exec testProc2 @result1 output,@result2 output,'e'
select @result1,@result2