I have a problem here, I'm searching in stackoverflow but still not find the best way
i have a stored procedure (SP) like this
DECLARE @table NVARCHAR(max), @SQLQuery NVARCHAR(max) SET @table = @meta+'_prize4winner'
SET @SQLQuery = 'if exists (Select * from [dbo].' + @table + ' where idCampaignLog =''' + convert(nvarchar, @ID) +''') exec InsertC2CWinner''' + convert(nvarchar, @meta) +''','''+ convert(nvarchar, @ID)+''',null else select ''you lose ''as winStatus'
execute SP_EXECUTESQL @SQLQuery
need help how and where to set the output if I want the output if exist 'YOU WIN' else 'You Lose' thx