how to create a scrollable cursor with the scroll option? : Sql server database administration
Answer / Pradip Kumar Srivastava
"DECLARE @cursor CURSOR FOR SELECT * FROM table_name; OPEN @cursor; DECLARE @row CURSOR_STATUS; SET @row = 0; WHILE (@row <> -1) BEGIN FETCH NEXT FROM @cursor INTO @var1, @var2, ..., @varN; SELECT @row = @@FETCH_STATUS; IF (@row > 0) CONTINUE; END; CLOSE @cursor; DEALLOCATE @cursor": This code creates a scrollable cursor that allows you to move backward and forward through the result set. The addition of the "scroll" option in the FETCH NEXT statement enables this functionality.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is Self Join?
What is an active database?
How to create user defined functions with parameters?
What are the restraints imposed on the table design by a merge replication?
Due to some maintenance being done, the sql server on a failover cluster needs to be brought down. How do you bring the sql server down?
What is use of @@ spid in sql server?
Explain why variables called the most powerful component of ssis?
How do I list the available tables in a database I'm querying?
which backup strategy you are following at ur company
When do u use clustered index and non-clustered index?
What are the differences between union, intersect, and minus operators?
What are the types of constraints?
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)