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