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

    Sep 25, 2018 · To use cursors in SQL procedures, you need to do the following: 1.Declare a cursor that defines a result set. 2.Open the cursor to establish the result set. 3.Fetch the data …

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

    After recently switching from Oracle to SQL Server (employer preference), I notice cursor support in SQL Server is lagging. Cursors are not always evil, sometimes required, sometimes much …

  3. python - Why do you need to create a cursor when querying a …

    The SQL:2003 standard defines positioned update and positioned delete SQL statements for that purpose. Such statements do not use a regular WHERE clause with predicates. Instead, a …

  4. t sql - when should we use sql cursor - Stack Overflow

    Jun 15, 2012 · A cursor is a named SQL statement. From the PL/SQL User's Guide and Reference Manual (Page 2-16): When a query returns multiple rows, you can explicitly define …

  5. How to use variables in SQL statement in Python?

    Oct 20, 2021 · After that, you can create two variables, one for the SQL and one for the parameters: sql = 'INSERT INTO table VALUES ?,?,?' data = (var1, var2, var3) …

  6. sql - Cursor inside cursor - Stack Overflow

    Avoid SQL Cursor in this scenario. 5. SQL Server - Cursor. 0. nested Cursor TSQL (SQL Server) 0.

  7. How do I loop through a set of records in SQL Server?

    By using T-SQL and cursors like this : DECLARE @MyCursor CURSOR; DECLARE @MyField YourFieldDataType; BEGIN SET @MyCursor = CURSOR FOR select top 1000 YourField …

  8. sql server - What are the different ways to replace a cursor? - Stack ...

    Jan 6, 2022 · I've replaced some cursors with WHILE loops. DECLARE @SomeTable TABLE ( ID int IDENTITY (1, 1) PRIMARY KEY NOT NULL, SomeNumber int, SomeText varchar ) …

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

    Dec 22, 2021 · Even the fast forward cursor in Sql Server 2005 can't compete with set-based queries. The graph of performance degradation often starts to look like an n^2 operation …

  10. How to convert SQL Query result to PANDAS Data Structure?

    import pandas import pyodbc sql = 'select * from table' cnn = pyodbc.connect(...) data = pandas.read_sql(sql, cnn) Prior to 0.12, you could do: import pandas from pandas.io.sql import …

Refresh