存储过程exec输出

时间:2015-01-14 04:43:54

标签: sql-server stored-procedures

我的代码

DECLARE @table NVARCHAR(max), @SQLQuery NVARCHAR(max) SET @table = @meta+'_prize4winner' 
DECLARE @CNT2 VARCHAR(100)

SET @SQLQuery = 'if exists (Select * from [dbo].' + @table + ' where idCampaignLog =''' + convert(nvarchar, @ID) +''') exec InsertWinner ''' + convert(nvarchar, @meta) +''','''+ convert(nvarchar, @ID)
+''',null  else select ''you lose ''as winStatus'
--print @SQLQuery

execute SP_EXECUTESQL @SQLQuery

我如何从SP_Execute @SQLQuery获取结果作为OUTPUT,我尝试了很多但仍然找不到方法,thx

0 个答案:

没有答案