我的代码
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