是否可以将Table-Valued参数用作存储过程的输出参数?
这是我想在代码中做的事情
/*First I create MY type */ CREATE TYPE typ_test AS TABLE ( id int not null,name varchar(50) not null,value varchar(50) not null PRIMARY KEY (id) ) GO --Now I want to create stored procedu whic is going to send output type I created,--But it looks like it is inpossible,at least in sql2008 create PROCEDURE [dbo].sp_test @od datetime,@do datetime,@poruka varchar(Max) output,@iznos money output,@racun_stavke dbo.typ_test READONLY --Can I Change READONLY with OUTPUT ? AS BEGIN SET NOCOUNT ON; /*FILL MY OUTPUT PARAMS AS I LIKE */ end
解决方法
不,遗憾的是,表值参数是只读的和仅输入的.一般来说,这个主题在
How to Share Data between Stored Procedures中得到了很好的介绍,它提供了所有替代方案.我的建议是使用#temp表.