时间:2021-07-01 10:21:17 帮助过:3人阅读
declare @sql nvarchar(max)
declare @nu int
set @sql=‘SELECT * FROM [FMTest].[dbo].[FM_Radio_Station]‘
set @sql=‘SELECT @nu=count(0) from(‘+@sql+‘)aa‘
EXEC sp_executesql @sql,N‘@nu AS INT OUTPUT‘,@nu OUTPUT
SELECT @nu
EXEC sp_executesql
标签: