从动态SQL中返回值
发表于:2007-06-08来源:作者:点击数:
标签:
declare @TransactorID int
set @TransactorID=0
print(@TransactorID)
--exec sp_execute
sql N'select @TransactorID=68 ',N'@TransactorID int ',@TransactorID
exec sp_executesql N'select @TransactorID=5 ',N'@TransactorID int out ',@TransactorID out
print(@TransactorID)
原文转自:http://www.ltesting.net