create procedure sp_voxtelrecord
@anum varchar(20),
@flag char
as
declare @resultflag char
begin
exec sp_updfreerecord @anum,@resultflag
insert into testpro(telnum,flag) values(@anum ,@resultflag)
end
---------------------------------------------------------
create procedure sp_updfreerecord
@anum varchar(20),
@flag char out,
as
declare @statusflag char
begin
select @flag = 'S '
insert into testpro(telnum,flag) values(@anum, @flag)
select @flag
return
end
----执行后testpro 表结果如下-------------
sn telnum flag
1 12345 S
2 12345 null
问题:为什么testpro 不是如下结果,参数返回写法有什么问题吗?
------------------------------------
sn telnum flag
1 12345 S
2 12345 S
------解决方案--------------------------------------------------------
--如果是输出参数,调用时应该带out
exec sp_updfreerecord @anum,@resultflag out