时间:2021-07-01 10:21:17 帮助过:24人阅读
动态查询输出字符串 无 declare?@sql1?nvarchar(200),@sql2?nvarchar(200)declare?@count?nvarchar(100);set?@sql1?=?'SELECT?CONVERT(varchar(100),?GETDATE(),?0)'set?@sql2?=?'SELECT?@count?=?CONVERT(varchar(100),?GETDATE(),?0)'exec?sp_executesql??@
动态查询输出字符串 <无>declare?@sql1?nvarchar(200),@sql2?nvarchar(200) declare?@count?nvarchar(100); set?@sql1?=?'SELECT?CONVERT(varchar(100),?GETDATE(),?0)' set?@sql2?=?'SELECT?@count?=?CONVERT(varchar(100),?GETDATE(),?0)' exec?sp_executesql??@sql2,N'@count?nvarchar(50)?out',@count?out print?@sql1?+':'+?@count