Explain how to create a Scrollable Cursor with the SCROLL Option

Explain how to create a Scrollable Cursor with the SCROLL Option.

Syntax for Scrollable cursor:
DECLARE cursor_name [INSENSITIVE] [SCROLL] CURSOR
FOR select_statement
[FOR {READ ONLY | UPDATE [OF column_name [,...n]]}]

Explain how to create a Scrollable Cursor with the SCROLL Option.

Using the SCROLL keyword while declaring a cursor allows fetching of rows in any sequence.

Example:
DECLARE employee_curs SCROLL CURSOR FOR SELECT * FROM employee;

The active set of the cursor is stored can be accessed in any order without the need of opening and closing the cursor. The Scroll cursors can be set for select and function cursors but not insert or update statements.
Explain how to create a Dynamic Cursor with the DYNAMIC Option
Create a Dynamic Cursor with the DYNAMIC Option - When a cursor is declared as DYNAMIC, the cursor reflects all changes made to the base tables as the cursor is scrolled around......
SQL Server System database - Master,MSDB,TEMPDB,Model
SQL Server System database - Describe in brief system database. You can find answer to this question in this series.
SQL Server Transaction Architecture interview questions
SQL Server Transaction Architecture - What operations do SQL Server transaction logs support?, Explain the purpose of check points in a transaction log., What is write-ahead transaction log?
Post your comment