
Why is it considered bad practice to use cursors in SQL Server?
Dec 22, 2021 · 71 I knew of some performance reasons back in the SQL 7 days, but do the same issues still exist in SQL Server 2005? If I have a resultset in a stored procedure that I want to …
sql server - What is an alternative to cursors for sql looping?
Aug 1, 2019 · Using SQL 2005 / 2008 I have to use a forward cursor, but I don't want to suffer poor performance. Is there a faster way I can loop without using cursors?
SQL Server Fast Forward Cursors - Stack Overflow
The 'Best Practice' of avoiding cursors in SQL Server dates back to SQL Server 2000 and earlier versions. The rewrite of the engine in SQL 2005 addressed most of the issues related to the …
Using a cursor with dynamic SQL in a stored procedure
Another option in SQL Server is to do all of your dynamic querying into table variable in a stored proc, then use a cursor to query and process that. As to the dreaded cursor debate :), I have …
Is there any way to get a list of open/allocated cursors in SQL …
Then subsequent runs fail when it tries to create cursors since a cursor with the name already exists. Is there a way I can query which cursors exists and if they are open or not so I can …
How to use cursor within cursor in SQL Server? - Stack Overflow
Jan 18, 2017 · I have the following query, I want use a nested cursor in my query. How to do this, because it's not running and I am new to SQL Server. Please help me CHECK TABLE …
sql - How to check if cursor exists (open status) - Stack Overflow
Feb 11, 2016 · The error will occur in the nested stored procedure when it attempts to open "cur". Run this bit of sql to see your CURSOR_DEFAULT:
Declaring cursor to loop over some values in SQL Server 2008 R2
Explore related questions sql-server-2008 cursors See similar questions with these tags.
sql - Cursor inside cursor - Stack Overflow
One more question: what version of sql server, because that will determine what we can use for creating the row numbers to replace your @counter in the inner cursor.
Update with a cursor in SQL Server 2008 R2 - Stack Overflow
Update with a cursor in SQL Server 2008 R2 Asked 13 years, 11 months ago Modified 3 years, 3 months ago Viewed 51k times