从动态SQL中返回值

类别:数据库 点击:0 评论:0 推荐:
declare @TransactorID int
set @TransactorID=0
print(@TransactorID)
--exec sp_executesql N'select @TransactorID=68 ',N'@TransactorID int ',@TransactorID
exec sp_executesql N'select @TransactorID=5 ',N'@TransactorID int out ',@TransactorID out
print(@TransactorID)

本文地址:http://com.8s8s.com/it/it19910.htm