About 269,000 results
Open links in new tab
  1. 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 …

  2. 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?

  3. 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 …

  4. 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 …

  5. 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 …

  6. 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.

  7. How to use cursor within cursor in SQL Server? - Stack Overflow

    Jan 18, 2017 · 1 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

  8. 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.

  9. 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:

  10. How to write a cursor inside a stored procedure in SQL Server 2008

    Nov 22, 2012 · How to write a cursor inside a stored procedure in SQL Server 2008 Asked 13 years ago Modified 8 years, 3 months ago Viewed 122k times