How to transfer data from a cursor to variables with a "fetch" statement?
Answer / Anand Kumar Jha
"To transfer data from a cursor to variables using the FETCH statement in MS SQL Server, you can use the DECLARE, OPEN, and FETCH statements. Here's an example:nnDECLARE @var1 INT;nDECLARE @var2 VARCHAR(50);nDECLARE myCursor CURSOR FOR SELECT col1, col2 FROM table_name;nOPEN myCursor;nFETCH NEXT FROM myCursor INTO @var1, @var2;..."
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the maximum size of column in sql server?
what is lazy writer?
When do you use SQL Profiler?
Explain the use of containers in ssis?
write the query for taking database backup in sql
10 Answers ABC, IBM, Logica CMG, MA,
how do you implement one-to-one, one-to-many and many-to-many relationships while designing tables? : Sql server database administration
What is deadlock and how to avoid the deadlocks.
what are the disadvantages of cursors? : Sql server database administration
How to list all field names in the result set using mssql_field_name()?
What does sql server mean?
Define ACID properties in a Database?
what is the Enterprise manager(2000) and management studio (2005)?
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)