C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » SQL Server »

SQL Index and cursor


Posted Date: 06 Nov 2009      Posted By: Pughal      Member Level: Bronze     Points: 1   Responses: 2



detail and usage of index and cursor in sql server 2005 . and main usage and how to declaration syntax...step by step






Responses

Author: Hari    06 Nov 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

Cursor

Cursor is a database object used by applications to manipulate data in a set on a row-by-row basis, instead of the typical SQL commands that operate on all the rows in the set at one time. For example, you can use cursor to include a list of all user databases and make multiple operations against each database by passing each database name as a variable

ALTER PROCEDURE cursorsample
AS
DECLARE @AuthorID int
DECLARE c1 scroll CURSOR FOR SELECT bonus_id FROM bonus
OPEN c1
--FETCH NEXT FROM c1 INTO @AuthorID
WHILE @@FETCH_STATUS = 0
BEGIN
IF (@autherid>0)
PRINT @AuthorID
FETCH last FROM c1 INTO @AuthorID
END

CLOSE c1
DEALLOCATE c1


INDEX -- Here is a pictorial tutorial about indexex

http://www.exforsys.com/tutorials/sql-server-2005/sql-server-defining-indexes.html



Author: rajasekaran    07 Nov 2009Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

http://www.mssqltips.com/tip.asp?tip=1599


Post Reply
You must Sign In to post a response.
Next : Update Local to Remote DataBase?
Previous : Sql 2005
Return to Discussion Forum
Post New Message
Category: SQL Server

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use