<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE>@font-face {
font-family: Tahoma;
}
@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; }
P.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
COLOR: purple; TEXT-DECORATION: underline
}
P.MsoAutoSig {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoAutoSig {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoAutoSig {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
SPAN.EmailStyle17 {
FONT-WEIGHT: normal; COLOR: windowtext; FONT-STYLE: normal; FONT-FAMILY: Tahoma; TEXT-DECORATION: none
}
DIV.Section1 {
page: Section1
}
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV><SPAN class=464413014-12022003><FONT face=Arial color=#0000ff size=2>The
format is...</FONT></SPAN></DIV>
<DIV><SPAN class=464413014-12022003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=464413014-12022003><FONT face=Arial color=#0000ff size=2>WHILE
(condition = true)</FONT></SPAN></DIV>
<DIV><SPAN class=464413014-12022003><FONT face=Arial color=#0000ff
size=2>BEGIN</FONT></SPAN></DIV>
<DIV><SPAN class=464413014-12022003> <FONT face=Arial><FONT
color=#0000ff size=2>-- do processing</FONT></FONT></SPAN></DIV>
<DIV><SPAN class=464413014-12022003> </SPAN></DIV>
<DIV><SPAN class=464413014-12022003><FONT face=Arial color=#0000ff
size=2>END</FONT></SPAN></DIV>
<DIV><SPAN class=464413014-12022003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=464413014-12022003><FONT face=Arial color=#0000ff size=2>Keep
in mind that a direct translation of programming logic from whatever to TSql may
not be the best way to go. If you post what you are trying to do, people
may be able to give you an alternative to using a loop (which tend to be much
slower than set-based statements).</FONT></SPAN></DIV>
<DIV><SPAN class=464413014-12022003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> Mark Boyd
[mailto:MarkBoyd@mcbeeassociates.com] <BR><B>Sent:</B> 12 February 2003 9:26
AM<BR><B>To:</B> SQLServerList<BR><B>Subject:</B> [dba-SQLServer]Do Loop in a
sproc<BR><BR></FONT></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Tahoma size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">I am converting VBA code to a
stored procedure.</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Tahoma size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">This code includes a pretty large
Do Loop.</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Tahoma size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">Is it possible to create a loop
in a sproc?</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Tahoma size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">If so, what is the
format?</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Tahoma size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Tahoma size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">Thanks,</SPAN></FONT></P>
<P class=MsoAutoSig><FONT face=Tahoma size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">Mark Boyd</SPAN></FONT></P>
<P class=MsoAutoSig><FONT face=Tahoma size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">Sr. Systems
Analyst</SPAN></FONT></P>
<P class=MsoAutoSig><FONT face=Tahoma size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">McBee Associates,
Inc.</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=#0000ff size=2><SPAN
style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV></BLOCKQUOTE></BODY></HTML>