declare @tablename nvarchar(50)
declare @count int
set @tablename = ‘SplitzRank‘
declare @sqlstr nvarchar(512)
set @sqlstr = ‘select @count=count(*) from ‘[email protected]
select @sqlstr
exec sp_executesql @sqlstr,N‘@count int output‘,@count output
select @count
sql数据库表名做参数
时间: 2024-10-11 08:20:55