游标在数据库中的用途是什么 [英] what is the use of cursor in database

查看:190
本文介绍了游标在数据库中的用途是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

数据库中游标的用途是什么

what is the use of cursor in database

推荐答案

这是游标用法的一个很好的例子

http://www.mssqltips.com/tip.asp?tip=1599 [ ^ ]

我通常将它们用于非工作时间"或基于admin的任务,其中工作单元(例如,在上面的示例中,数据库BACKUP)非常大.

游标为您的结果集提供逐行操作",但是-通常还有其他方法可以实现所需的功能-通常具有更好的性能.

这里也有一些很好的信息

http://www.sql-server-performance.com/tips/cursors_p1.aspx [ ^ ]
This is a good example of cursor usage

http://www.mssqltips.com/tip.asp?tip=1599[^]

I generally use them for ''out of hours'' or admin based task where the unit of work (e.g. in the above example, a database BACKUP) is very large.

A cursor provides ''row-by-row operations'' for your result set, however - there are usually other ways to accomplish the desired functionality - often with much better performance.

Some good info here as well

http://www.sql-server-performance.com/tips/cursors_p1.aspx[^]


这篇关于游标在数据库中的用途是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆