| Author: Hari 06 Nov 2009 | Member Level: Gold | Rating:  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 2009 | Member Level: Silver | Rating:  Points: 2 |
http://www.mssqltips.com/tip.asp?tip=1599
|