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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Anupam SinghPosted May 22, 2014, 3:01 AM
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.
Khan Abrar AhmedPosted May 22, 2014, 5:25 AM
http://msdn.microsoft.com/en-us/library/ms181441.aspx
http://www.sqlservergeeks.com/articles/sql-server-bi/31/sql-server-what-is-a-cursor
Abhay ShankerPosted May 22, 2014, 2:07 AM
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
Bhabani PrasadPosted May 22, 2014, 1:51 AM