DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Melanie Norton Guest

    For....Next loop

    Is there a loop that I could use in TSQL that is equivalent to the
    For...Next in VB? I need to be able to loop through a recordset in a stored
    procedure and right now I am using a cursor. Thanks for the help.

    Melanie



  2. #2
    DaveSatz Guest

    Re: For....Next loop

    the example under DECLARE CURSOR (T-SQL) in BOL should help.
    --
    HTH,
    David Satz
    Principal Software Engineer
    Hyperion Solutions
    ->Using SQL Server 7.0 SP3/6.5 SP5a/Cold Fusion 4.5.1 SP2/VSS
    (Please reply to group only - emails answered rarely)
    -----------------------------------------------------------------

    "Melanie Norton" <mnorton@atcoflex.com> wrote in message
    news:3aa93f74@news.devx.com...
    > Is there a loop that I could use in TSQL that is equivalent to the
    > For...Next in VB? I need to be able to loop through a recordset in a

    stored
    > procedure and right now I am using a cursor. Thanks for the help.
    >
    > Melanie
    >
    >




  3. #3
    DaveSatz Guest

    Re: For....Next loop

    WHILE is the only looping construct in TSQL.

    "DaveSatz" <davidsatz@yahoo.com> wrote in message
    news:3aa948c2@news.devx.com...
    > the example under DECLARE CURSOR (T-SQL) in BOL should help.
    > --
    > HTH,
    > David Satz
    > Principal Software Engineer
    > Hyperion Solutions
    > ->Using SQL Server 7.0 SP3/6.5 SP5a/Cold Fusion 4.5.1 SP2/VSS
    > (Please reply to group only - emails answered rarely)
    > -----------------------------------------------------------------
    >
    > "Melanie Norton" <mnorton@atcoflex.com> wrote in message
    > news:3aa93f74@news.devx.com...
    > > Is there a loop that I could use in TSQL that is equivalent to the
    > > For...Next in VB? I need to be able to loop through a recordset in a

    > stored
    > > procedure and right now I am using a cursor. Thanks for the help.
    > >
    > > Melanie
    > >
    > >

    >
    >




Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links