How many types of cursors are there in SQL Server?
Answers were Sorted based on User's Feedback
Answer / nalini
Cursor is the current position of recordset.There are 4
types of cursors.
1.forward Only (Default)
|Is This Answer Correct ?||31 Yes||4 No|
Answer / santosh kumar sharma
There are 4 types of cursor.
1) Static: Cursor can move to any record but the changes on
the data can't be seen.
2) Dynamic: Most resource extensive. Cursor can move
anywhere and all the changes on the data can be viewed.
3) forward-only: Cursor moves one step forward. Can't move
4) Key setdriven: Only Updated data can be viewed. Deleted
and Inserted data cannot be viewed.
|Is This Answer Correct ?||18 Yes||3 No|
There are five type of cursors in SQL server.
1)Base table:- This is lowest level cursor.
2)Static :- This is scrollable query cursor in earlier
versions of SQL Server Compact Edition
3)Forward-only:- The forward-only cursor is the fastest
cursor that you can update, but it does not support
4)Forward-only/Read-only:- Forward-only/read-only cursors,
referred to as forward-only cursors in earlier versions of
SQL Server Compact Edition, are the fastest cursors, but
cannot be updated.
5)Keyset-driven:- The keyset-driven cursor in SQL Server
Compact Edition is a scrollable cursor that you can update.
A keyset-driven cursor is controlled by a set of physical
identifiers known as the keyset.
|Is This Answer Correct ?||13 Yes||3 No|
There can be 7 types of Cursors in SQL Server
1] Dynamic : Scrollable. Its slowest, and sensitive to all changes in resultset.
2] Keyset : Scrollable. Its slow but faster than Dynamic.Sensitive to Changes like updation and deletion but not insertion
3] Static : Its srollable and faster than both above. We can move forward and backward, but changes are not visible
4] Forward_Only Dynamic : Its not scrollable, but sensitive to changes.
5] Forward_only keyset : Its not scrollable, but sensitive to updation and deletion in resultset but not insertion. We can only move forward and not backward.
6] Forward_only Static : Not sensitive to changes not scrollable.
7] Fast-forward : fastest among all.
|Is This Answer Correct ?||1 Yes||6 No|
How cand Optimize SQL Server Stored Procedures
what are batch in sql server?
How to fetch records from a One to Many relationship table. eg: wanna get details of all orders for a specific customer. (do not want repeatation of master table records for child table records)
Suppose i have a table that contains 5 columns like col1,col2...colm5.I want to import only two column through BCP utility.How to do same through BCP in sybase.
Can Somebody tell me the difference between Clustered & Non- Clustered Index??
write the query for find the top 2 highest salary in sql server
How much memory that we are using in Logshipping Concept?
Hi, I have a table A which has four rows as follows Table A ------- empname salary ------- ------ A 1000 B 2000 C 3000 A 1000 B 2000 D 5000 I need the following output: empname salary ------- ------ A 1000 A 1000 B 2000 B 2000 Thanks in advance
How to work on DTS?what is the main requirement?
How many types of Outer Joins?What are they?
How do you optimize Sql queries ?
How will u get 5 years back record?