C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




for loop


Posted Date: 07 Oct 2008      Total Responses: 3

Posted By: arun upadhyay       Member Level: Bronze     Points: 1


can we use for loop in stored procedure? if yes then how?



Responses

Author: Antony s Nasarath    07 Oct 2008Member Level: SilverRating:     Points: -20
Hi You can use cursor for this and cursor basically get set of selected record and you can loop thought each record and do whatever you want

Code sam[ple

DECLARE @AuthorID char(11)

DECLARE c1 CURSOR READ_ONLY
FOR
SELECT au_id
FROM authors

OPEN c1

FETCH NEXT FROM c1
INTO @AuthorID

WHILE @@FETCH_STATUS = 0
BEGIN

PRINT @AuthorID

FETCH NEXT FROM c1
INTO @AuthorID

END

CLOSE c1
DEALLOCATE c1

for more inof visit http://www.sqlteam.com/article/cursors-an-overview

Regards



Author: victoria    07 Oct 2008Member Level: GoldRating:     Points: 2
check this link..

http://www.eggheadcafe.com/software/aspnet/30737775/how-to-set-up-a-for-loop.aspx


Author: karthikeyan-The Great    07 Oct 2008Member Level: GoldRating:     Points: -20
use cursor

the term cursor refers to a control structure for the successive traversal (and potential processing) of records in a result set.

A cursor is used for processing individual rows returned by the database system for a query.


Post Reply
You must Sign In to post a response.
Next : To Meetu Choudhary Plz Help
Previous : Configure SMTP Server
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

efax

Contact Us    Privacy Policy    Terms Of Use