获取动态TSQL语句返回值
DECLARE @Sql nVarchar(4000)
Declare @Total int
SET @Sql=N'SELECT @Total=Count(*) FROM PE_CommonModel'
Exec sp_executesql @Sql, N'@Total Int Out',@Total Out
Print @Total
Declare @Total int
SET @Sql=N'SELECT @Total=Count(*) FROM PE_CommonModel'
Exec sp_executesql @Sql, N'@Total Int Out',@Total Out
Print @Total