Explain how to create a Dynamic Cursor with the DYNAMIC Option

Explain how to create a Dynamic Cursor with the DYNAMIC Option.

Dynamic cursor depicts the fact that the cursor will reflect all data changes made to the base tables as the user scrolls around the cursor.

Syntax:
DECLARE cursor_name CURSOR
[LOCAL | GLOBAL]
[FORWARD_ONLY | SCROLL]
[STATIC | KEYSET | DYNAMIC | FAST_FORWARD]
[READ_ONLY | SCROLL_LOCKS | OPTIMISTIC]
[TYPE_WARNING]
FOR select_statement
[FOR UPDATE [OF column_name [,...n]]]

Explain how to 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.

Declare cursor_name cursor

[ STATIC | KEYSET | DYNAMIC | FAST_FORWARD ]

FOR select_statement

The dynamic option does not support ABSOLUTE FETCH.
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?
What is use of DBCC Commands?
What is use of DBCC Commands? - Database Consistency Checker Commands give details in form of statistics about the SQL Server.......
Post your comment