以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 HTML/XHTML/Ajax/Web 2.0/Web 3.0 』  (http://bbs.xml.org.cn/list.asp?boardid=22)
----  [求助]关于MSSQL 2000中游标的问题——已解决  (http://bbs.xml.org.cn/dispbbs.asp?boardid=22&rootid=&id=74105)


--  作者:a320106025461
--  发布时间:4/12/2009 3:50:00 PM

--  [求助]关于MSSQL 2000中游标的问题——已解决
SQL 2000中  用游标复制表的内容(两个表的结构相同)
新建一个表student1,把表student中的内容复制到student1中
把student表中的字段声明成变量,然后把游标的值赋值给变量在插入student1表中
declare number_cursor cursor for
select sno,sname,ssex,sage,sdept from student.dbo.student
open number_cursor
fetch next from number_cursor
while @@fetch_status=0
begin
        fetch next from number_cursor
end
close number_cursor
deallocate number_cursor
只是缺少变量而已


[此贴子已经被作者于2009-4-13 22:12:13编辑过]

--  作者:a320106025461
--  发布时间:4/12/2009 3:51:00 PM

--  
紧急问题,急需帮住啊!


[此贴子已经被作者于2009-4-12 20:53:22编辑过]

W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
46.875ms