Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009
Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 

Creating Cursor using PL-Sql in Sql Server 2008

Author: Zunnair

In This article I will explain What is cursor, its Types and the way in which we can create Cursor and use it

The main option for a cursor is whether the data is on the client or the server.

·       Client cursors are good for spreading the workload across many workstations.

·       Server cursors are good for lightweight clients who can't afford to cache a large result set. Server cursors do not support multiple result sets or these SQL keywords: COMPUTE, COMPUTE BY, FOR BROWSE, or INTO.

Types of Cursor

  • Forward-Only
  • Static
  • Keyset
  • Dynamic

The syntax for specifying a cursor is dependent on the method for making the cursor. SQL Server supports two possible methods for making cursors: via DECLARE CURSOR or via a DB API. Applications should choose one or the other but not both.

USE pubs

GO

DECLARE authors_cursor CURSOR FOR

SELECT au_lname FROM authors

WHERE au_lname LIKE 'D%'

ORDER BY au_lname

 

OPEN authors_cursor

FETCH NEXT FROM authors_cursor

WHILE @@FETCH_STATUS = 0

BEGIN

   FETCH NEXT FROM authors_cursor

END

CLOSE authors_cursor

DEALLOCATE authors_cursor

GO

 

I hope this article will be help full for you and easy to understand.
Article Comments
it is a fine programe which is done by you.
please provide good examples between two oracles

Posted on 6/16/2010 7:50:13 AM by bheema simha

   
Add Article Comment:
Name :
Email Address :
   
Comments :
 
   
<< Using Microsoft Notification Services using MS Sql Server 2005 (Part 2)

Disclaimer - Privacy
© 2002-2017 DevASP.net