社区
MS-SQL Server
帖子详情
sp_executesql为什么不能得到数据集的值?急!!!!!!!!!!!!
sonkey
2005-01-26 08:26:08
execute sp_executesql @SelectSQL,--返回一个整数
N'@cnt int output',
@cnt output
Select @cnt--打印出来为NULL
请问怎么得到这个值呢?
...全文
120
5
打赏
收藏
sp_executesql为什么不能得到数据集的值?急!!!!!!!!!!!!
execute sp_executesql @SelectSQL,--返回一个整数 N'@cnt int output', @cnt output Select @cnt--打印出来为NULL 请问怎么得到这个值呢?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
sonkey
2005-01-26
打赏
举报
回复
多谢无声
问题解决了
didoleo
2005-01-26
打赏
举报
回复
假设为:Select 4
declare @SelectSQL nvarchar(4000),@cnt int
set @SelectSQL='select @cnt=4'
execute sp_executesql @SelectSQL,--返回一个整数
N'@cnt int output',
@cnt output
select @cnt
--------------
4
sonkey
2005-01-26
打赏
举报
回复
假设为:Select 4
mschen
2005-01-26
打赏
举报
回复
你的@selectSQL的内容是什么?
didoleo
2005-01-26
打赏
举报
回复
--给个例子你
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
经典全面的SQL语句大全
经典SQL语句大全 ...执行SQL查询语句时,将返回查询
得到
的记录集。用法为: Set 对象变量名=连接对象.Execute("SQL 查询语言") Execute方法调用后,会自动创建记录集对象,并将查询结果存储在该记录...
sp_executesql
_
sp_executesql
存储过程简介和示例
sp_executesql
The
sp_executesql
is a built-in stored procedure in SQL Server that enables to execute of the dynamically constructed SQL statements or batches. Executing the dynamically constructe...
sqlserver 动态sql执行execute和
sp_executesql
sqlserver 动态sql的执行,有两个方法execute和
sp_executesql
.其中第一个方法execute可以简写为exec. execute方法适合执行没有返回
值
的动态sql,
sp_executesql
可以获取到动态sql的返回
值
.二者比较起来,前者写起来简单...
SQL
数据
库引擎语句
sp_executesql
的使用介绍(Transact-SQL)
sp_executesql
(Transact-SQL)
sp_executesql
介绍和使用
sp_executesql
MS-SQL Server
34,593
社区成员
254,589
社区内容
发帖
与我相关
我的任务
MS-SQL Server
MS-SQL Server相关内容讨论专区
复制链接
扫一扫
分享
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章