adspace
How to transfer data from a cursor to variables with a "fetch" statement?
Answer Posted / 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 |
Post New Answer View All Answers
What are the properties of the transaction?
What is a coalesce function?
How to rebuild the master database?
What are the risks of storing a hibernate-managed object in a cache? How do you overcome the problems?
List the ways in which dynamic sql can be executed?
What is acid mean in sql server?
Disadvantages of the indexes?
What is normalization and what are the advantages of it?
Can one drop a column from a table?
Does view occupy space?
Explain system functions or built-in functions? What are different types of system functions?
What are different types of constraints?
What is standby servers? Explain types of standby servers.
Why we use the openxml clause?
If you're given a raw data table, how would perform etl (extract, transform, load) with sql to obtain the data in a desired format?