About 5,440,000 results
Open links in new tab
  1. What is the use of a cursor in SQL Server? - Stack Overflow

    Sep 25, 2018 · Cursor might used for retrieving data row by row basis.its act like a looping statement (ie while or for loop). To use cursors in SQL procedures, you need to do the following: 1.Declare a …

  2. Using a cursor with dynamic SQL in a stored procedure

    A cursor will only accept a select statement, so if the SQL really needs to be dynamic make the declare cursor part of the statement you are executing. For the below to work your server will have to be …

  3. sql - What are the benefits of using database cursor? - Stack Overflow

    Oct 5, 2010 · Using a cursor it is possible to read sequentially through a set of data, programmatically, so it behaves in a similar manner to conventional file access, rather than the set-based behaviour …

  4. How to put parameterized sql query into variable and then execute in ...

    Apr 25, 2014 · I understand that the correct way to format a sql query in Python is like this: cursor.execute ("INSERT INTO table VALUES (%s, %s, %s)", var1, var2, var3) so that it prevents sql …

  5. sql server - Can I reset cursor's position to the beginning? - Stack ...

    Jun 26, 2013 · STATIC Defines a cursor that makes a temporary copy of the data to be used by the cursor. All requests to the cursor are answered from this temporary table in tempdb; therefore, …

  6. Get Multiple Values in SQL Server Cursor - Stack Overflow

    Get Multiple Values in SQL Server Cursor Asked 14 years, 10 months ago Modified 3 years, 11 months ago Viewed 157k times

  7. Why is it considered bad practice to use cursors in SQL Server?

    Dec 22, 2021 · Which is best? Hardcoding the SQL to do what I need to? Or iterate through this resultset and use dynamic-SQL (sp_executesql) to perform the operations? There is no way to …

  8. PL/SQL print out ref cursor returned by a stored procedure

    How can I fetch from a ref cursor that is returned from a stored procedure (OUT variable) and print the resulting rows to STDOUT in SQL*PLUS? ORACLE stored procedure: PROCEDURE …

  9. sql - is it a best practice to use while loop vs Cursor ... - Stack ...

    Consider use "is it a best practice to use while loop vs Cursor?" for title as it's more clear and will appeal to more user for later use.

  10. Is there a way to use parameters in a SQL Server cursor?

    I tried this and found that the contents of the cursor does not change if you close the cursor, change the value in the variable, and then reopen the cursor. It appears that the cursor definition is "compiled" in …