Global web icon
stackoverflow.com
https://stackoverflow.com/questions/4222868/what-i…
What is the use of a cursor in SQL Server? - Stack Overflow
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 cursor that defines a result set. 2.Open the cursor to establish the result set. 3.Fetch the data into local variables as needed from the cursor, one row at a time. 4.Close the cursor when done. for ex:
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/1045880/using-…
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 using global cursors.
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/41713656/how-t…
How to use cursor within cursor in SQL Server? - Stack Overflow
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 SUGGEST LAT 31.8181 LONG 71.4146...
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/469019/cursor-…
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.
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/8652653/how-to…
sql - How to use cursor to update record - Stack Overflow
i am using below query to update my all records but it starts update from second row how can i modify it to do changes from 1'st row ? i am using mssql 2008 i think i can not use @@FETCH_STATUS ...
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/4974981/get-mu…
Get Multiple Values in SQL Server Cursor - Stack Overflow
93 I have a cursor containing several columns from the row it brings back that I would like to process at once. I notice most of the examples I've seeing on how to use cursors show them assigning a particular column from the cursor to a scalar value one at a time, then moving to the next row, e.g.
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/14601407/using…
sql - Using a cursor with a CTE - Stack Overflow
I need a cursor for the below query so I can loop through to fetch/update/insert some other data. Can somebody help me with this? DECLARE @FROMDATE DATETIME DECLARE @TODATE DATETIME SELECT @FRO...
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/71836128/how-d…
sql server - How do I select multiple columns in a cursor ... - Stack ...
You select the actual columns in the query that defines the cursor, You then fetch those values into variables. There is an example in the documentation. Your FETCH is correct - the actual query that selects from the table is not. And a cursor that uses an undefined temp table is a bit unusual - but perhaps the code you posted is not complete.
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/8939700/sql-se…
t sql - SQL Server - Cursor - Stack Overflow
SQL Server - Cursor Asked 13 years, 10 months ago Modified 3 years, 9 months ago Viewed 17k times
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/4782813/if-els…
sql server - If-Else Condition inside cursor - Stack Overflow
My Current SQL Syntax is something like Declare CursorName CURSOR FOR Select Query Now the select query would contain an If-Else Condition. If @Parameter1 is NULL BEGIN Select-Query1 END ELSE