紧急求助! 我想在一个子过程中返回一个长字符串到调用过程中如何处理?
cwsj 2001-12-13 11:09:03 紧急求助! 我想在一个子过程中返回一个长字符串到调用过程中如何处理? 用return 只能返回数值? 不行! 用参数@ret_string OUTPUT 可能行! 但忘了怎幺做! 哪位高手帮我一下, 昨天送了100分还是未解决问题. 先谢谢啦!!!! 急用. 请参看例子:
drop procedure ret
go
create procedure ret
@o varchar(100) output
as
set @o = 'cwsj'
return 1
drop procedure test
go
create procedure test
as
declare @o varchar(100)
declare @x int
-- 调用ret存储过程,希望@o能返回调用过程中设定的字串
execute @x = ret @o
-- 结果发规@o为空白,并没返回我想要的‘cwsj'字串???
select o=@o
go
exec test