What is cursor
what is cursor and how to use the cursor and how to use the cursor in c#
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Anupam SinghRank #643 · 3.7K reputationPosted May 21, 2014, 11:01 PM EDT
Actually I saw you article and waiting for correction by your side.
Because C# and Cursor both are quite different.
Cursor is a feature of SQL Server and it works like foreach loop in C#.
you can find simple cursor example here
So we dont use cursor in C# ,we prefer foreach.
I would recommend you to do so.
Bhabani PrasadRank #8,369 · 223 reputationPosted May 21, 2014, 9:51 PM EDT
Abhay ShankerRank #375 · 6.7K reputationPosted May 21, 2014, 10:07 PM EDT
Cursor can also be defined as a set of rows together with a pointer that identifies a current row
DECLARE cursor_name CURSOR
[LOCAL | GLOBAL] --define cursor scope
[FORWARD_ONLY | SCROLL] --define cursor movements (forward/backward)
[STATIC | KEYSET | DYNAMIC | FAST_FORWARD] --basic type of cursor
[READ_ONLY | SCROLL_LOCKS | OPTIMISTIC] --define locks
FOR select_statement --define SQL Select statement
FOR UPDATE [col1,col2,...coln] --define columns that need to be updated
For more detail check below urls
http://msdn.microsoft.com/en-us/library/ms181441.aspx
http://www.sqlservergeeks.com/articles/sql-server-bi/31/sql-server-what-is-a-cursor
Khan Abrar AhmedRank #778 · 3K reputationPosted May 22, 2014, 1:25 AM EDT
http://msdn.microsoft.com/en-us/library/ms181441.aspx
http://www.sqlservergeeks.com/articles/sql-server-bi/31/sql-server-what-is-a-cursor