动态SQL语句案例

lcysts
33
2025-07-17

动态SQL语句案例

declare @COUNT int,@sql nvarchar(max)
set @sql = 'select @COUNT = count(id) from tbl_sys_dict where root_key = ''WT_TYPE'''
execute sp_executesql @sql, N'@COUNT int output', @COUNT output
print @COUNT
动物装饰