数据库

本类阅读TOP10

·SQL语句导入导出大全
·SQL Server日期计算
·SQL语句导入导出大全
·SQL to Excel 的应用
·Oracle中password file的作用及说明
·MS SQLServer OLEDB分布式事务无法启动的一般解决方案
·sqlserver2000数据库置疑的解决方法
·一个比较实用的大数据量分页存储过程
·如何在正运行 SQL Server 7.0 的服务器之间传输登录和密码
·SQL中两台服务器间使用连接服务器

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
SQL Server 2000游标使用方法

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

游标使用方法:
use db1
declare my_cursor cursor scroll dynamic /*scroll表示可随意移动游标指针(否则只能向前),dynamic表示可以读写游标(否则游标只读)*/
for
select 姓名 from 个人资料

open my_cursor
declare @name sysname
fetch next from my_cursor into @name
while(@@fetch_status=0)
  begin
    print '姓名: ' + @name
    fetch next from my_cursor into @name
  end
fetch first from my_cursor into @name
print @name
/* update 个人资料 set 姓名='zzg' where current of my_cursor */
/* delete from 个人资料 where current of my_cursor */
close my_cursor
deallocate my_cursor
正文 




相关文章

相关软件