For....Next loop


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: For....Next loop

  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
    > >
    > >

    >
    >




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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center