且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么在sql server中使用游标?

更新时间:2022-12-04 08:52:02





光标基本上是一个指针,它可以帮助我们遍历指定记录集的行。有关游标的更多信息,请参阅以下文章。



游标的SQL Server基础知识 [ ^ ]

游标 [ ^ ]

SQL Server不同类型的游标 [ ^ ]

SQL Server中的游标是什么? [ ^ ]

游标:概述 [ ^ ]



希望它有所帮助。
Hi,

Cursor is basically a pointer which help us to iterate through the rows of the specified record set. refer below articles for more on cursors.

SQL Server Basics of Cursors[^]
Cursors[^]
SQL Server Different Types of Cursors[^]
What is cursor in SQL Server?[^]
Cursors: An Overview[^]

hope it helps.


hi,



光标只是一个for循环概念。当您返回一些记录集并使用相同的过程执行功能时。作为基本建议不要使用光标。它会产生很多性能问题。使用游标时执行时间越来越多。主要缺点是它在服务器上分配了大量内存。更好地使用临时表概念来避免游标。





问候,

Prakash.T


Cursor is nothing but a for loop concept. While you returning some recordset and doing functionality with the same procedure. As the basic advise dont use cursor. It creates lot of performance issue. Executing time is getting more while used cursors. Main disadvantage is it allocates lot of memory on server. Better use temp table concept to avoid cursors.


Regards,
Prakash.T


这可能帮助你 - > http://bradsruminations.blogspot.in/2010/05/ [ ^ ]
This might help you -> http://bradsruminations.blogspot.in/2010/05/[^]