executesql存储过程
时间:2021-07-01 10:21:17
帮助过:92人阅读
代码如下:
declare @tt varchar(20)
set @tt = 'monisubbouns'
declare @int int
declare @sql nvarchar(500)
set @sql = 'select @int=count(*) from ' + @tt
exec sp_executesql @sql,N'@int int output',@int output
print @int