|
SQL server cursor - Interview questions
A Cursor is a database object that represents a result set
and is used to manipulate data row by row............
Read
answer
Declare the cursor,
Open the cursor,
Fetch record row by row,........
Read answer
DYNAMIC: It reflects changes happened on the table while
scrolling through the row............
Read
answer
Three types of locks
READ ONLY: This prevents any updates on the table.
SCROLL LOCK: This allows you to make changes to the table..............
Read answer
Close cursor when it is not required.
You shouldn’t forget to deallocate cursor after closing it...............
Read answer
Cursor requires a network roundtrip each time it fetches a
record, thus consume network resources...............
Read answer
You can use keyword SCROLL to make cursor Scrollable.
It can scroll to any row and can access the same row in the result set
multiple times................
Read answer
Temporary table This can improve processing speed but consume
disk space...............
Read answer
|
Cursors behavior can be controlled by dividing them into cursor types:
forward-only...............
Cursors can support various functionalities that are listed here................
Define Data definition language, What are the capabilities of Cursors?..........
Restrict Query Result for performance optimization, Restrict columns in the SQL
query, Use stored procedure instead of heavy duty queries, Avoid SQL cursor for
optimal performance, Use constraints instead of trigger, Use table variable
instead of temporary tables............
Index can be thought as index of the book that is used for fast retrieval of
information. Index uses one or more column index keys and pointers to the
record to locate record.........
This is the default and recommended security mode. In this mode, access to SQL
server is controlled by Windows NT.....
|
|