--给个例子你
declare @s nvarchar(4000),@i int
set @s='select @i=count(1) from orders'
exec sp_executesql @s,N'@i int output',@i output
select @i
declare @s nvarchar(4000),@i int
set @s='select @i=count(1) from orders'
exec sp_executesql @s,N'@i int output',@i output
select @i
解决方案 »
- MSSQLSERVER2012支持负载均衡吗?
- 关于SQL事务的疑惑
- 表联合查询问题?急 在线等!麻烦高手了
- 关于SQL字段为NULL的问题!求求各位大哥前辈看看指点一下小弟!小弟在线等待您的解答!
- 数据库远程备份问题
- select * from type where true?能在MS-SQL SERVER 2000中用吗?
- 几天没来,又改版了,信息的速度,问前辈一个问题,在sql server中的企业管理器,把值改为'上午 00:21:00',他自己变成上午 12:21:00,怎么办啊
- sql6.5的问题
- 怎么把查询SQL SERVER数据库后得到的结果转存为EXCEL文件呢?!
- 在sql server 6.5 中如何清空数据库日志???
- 分号在sqlserver中对t-sql或sql语句末尾有没有用?
- 又是交叉表的问题,这次要求用范围。求高手指教。
set @SelectSQL='select @cnt=4'
execute sp_executesql @SelectSQL,--返回一个整数
N'@cnt int output',
@cnt output
select @cnt--------------
4