SQL 代码解释

qzhjh 2014-08-13 11:16:46
麻烦大神帮忙解释以下代码的意思,谢谢
declare @P1 int
set @P1=180150181
declare @P2 int
set @P2=8
declare @P3 int
set @P3=1
declare @P4 int
set @P4=0
exec sp_cursoropen @P1 output, N'select * from tb1'
, @P2 output, @P3 output, @P4 output
select @P1, @P2, @P3, @P4
...全文
116 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
qqm05 2014-08-13
  • 打赏
  • 举报
回复

declare @P1 int--定义变量,变量名P1,类型为int
set @P1=180150181--给变量赋值
declare @P2 int--定义变量,变量名P2,类型为int
set @P2=8--给变量赋值
declare @P3 int--定义变量,变量名P3,类型为int
set @P3=1--给变量赋值
declare @P4 int--定义变量,变量名P4,类型为int
set @P4=0--给变量赋值
exec sp_cursoropen @P1 output, N'select * from tb1'
, @P2 output, @P3 output, @P4 output
--调用存储过程,存储过程名为sp_cursoropen,后面是它的5个参数,output指定该参数为输出参数
select @P1, @P2, @P3, @P4--查询这4个变量的值
qqm05 2014-08-13
  • 打赏
  • 举报
回复
declare @P1 int--定义变量,变量名P1,类型为int set @P1=180150181--给变量赋值 declare @P2 int--定义变量,变量名P2,类型为int set @P2=8--给变量赋值 declare @P3 int--定义变量,变量名P3,类型为int set @P3=1--给变量赋值 declare @P4 int--定义变量,变量名P4,类型为int set @P4=0--给变量赋值 exec sp_cursoropen @P1 output, N'select * from tb1' , @P2 output, @P3 output, @P4 output --调用存储过程,存储过程名为sp_cursoropen,后面是它的5个参数,output指定该参数为输出参数 select @P1, @P2, @P3, @P4--查询这4个变量的值

34,590

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧