2016-06-25 82 views

回答

2

使用sp_executesql的輸出參數

DECLARE @countnumber int = 0 

SET @sqlCommand = 'Set @countnumber = (SELECT count(*) from dsnv)' 

exec sp_executesql @sqlCommand, N'@countnumber int OUTPUT', @countnumber OUTPUT 

print @countnumber ; 
相關問題