Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Sarakumar
Posting Yak Master
108 Posts |
Posted - 2007-02-05 : 21:15:57
|
Hai, in sql server, we have a have cursor type called "keyset". how to use that. i learning that from sql server books online. i dont know how to implement it practically. This is for my knowldge im asking. i know that using cursor is not adviseable unless, we dont have any other option.Help me |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-02-05 : 22:18:06
|
from BOLquote: KEYSETSpecifies that the membership and order of rows in the cursor are fixed when the cursor is opened. The set of keys that uniquely identify the rows is built into a table in tempdb known as the keyset. Changes to nonkey values in the base tables, either made by the cursor owner or committed by other users, are visible as the owner scrolls around the cursor. Inserts made by other users are not visible (inserts cannot be made through a Transact-SQL server cursor). If a row is deleted, an attempt to fetch the row returns an @@FETCH_STATUS of -2. Updates of key values from outside the cursor resemble a delete of the old row followed by an insert of the new row. The row with the new values is not visible, and attempts to fetch the row with the old values return an @@FETCH_STATUS of -2. The new values are visible if the update is done through the cursor by specifying the WHERE CURRENT OF clause.
Also http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/iisbook/c07_keyset_cursors.mspx?mfr=true KH |
 |
|
|
|
|