<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 9">
<meta name=Originator content="Microsoft Word 9">
<link rel=File-List href="cid:filelist.xml@01C2D285.37A615F0">
<title>Message</title>
<!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:RelyOnVML/>
<o:DoNotRelyOnCSS/>
</o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:Zoom>0</w:Zoom>
<w:DocumentKind>DocumentEmail</w:DocumentKind>
<w:EnvelopeVis/>
</w:WordDocument>
</xml><![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:553679495 -2147483648 8 0 66047 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;
text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;
text-underline:single;}
p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig
{margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
span.emailstyle17
{mso-style-name:emailstyle17;
mso-ascii-font-family:Tahoma;
mso-hansi-font-family:Tahoma;
mso-bidi-font-family:Tahoma;
color:windowtext;
mso-text-animation:none;
font-weight:normal;
font-style:normal;
text-decoration:none;
text-underline:none;
text-decoration:none;
text-line-through:none;}
span.emailstyle19
{mso-style-name:emailstyle19;
mso-ascii-font-family:Tahoma;
mso-hansi-font-family:Tahoma;
mso-bidi-font-family:Tahoma;
color:blue;
mso-text-animation:none;
font-weight:normal;
font-style:normal;
text-decoration:none;
text-underline:none;
text-decoration:none;
text-line-through:none;}
span.EmailStyle20
{mso-style-type:personal;
mso-ansi-font-size:10.0pt;
mso-ascii-font-family:Arial;
mso-hansi-font-family:Arial;
mso-bidi-font-family:Arial;
color:navy;}
span.EmailStyle21
{mso-style-type:personal-reply;
mso-ansi-font-size:10.0pt;
mso-ascii-font-family:Arial;
mso-hansi-font-family:Arial;
mso-bidi-font-family:Arial;
color:#993366;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple style='tab-interval:.5in'>
<div class=Section1>
<p class=MsoNormal><span class=EmailStyle21><font size=2 color="#993366"
face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'>Ooops… it should be as this:<o:p></o:p></span></font></span></p>
<p class=MsoNormal><span class=EmailStyle21><font size=2 color="#993366"
face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:
Arial'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></font></span></p>
<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>UPDATE tblPrintCharges set ExceptionCode =
left(ExceptionCode,len(ExceptionCode) - 1) WHERE substring(ltrim(reverse(isnull(ExceptionCode,
‘ ‘))), 1, 1) = ‘,’</span></font><span class=EmailStyle21><font size=2
color="#993366" face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:
12.0pt;font-family:Arial'><o:p></o:p></span></font></span></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=black
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;color:black'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=black
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;color:black'>-----Original
Message-----<br>
<b><span style='font-weight:bold'>From:</span></b> Djabarov, Robert <br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, February 12, 2003
10:51 AM<br>
<b><span style='font-weight:bold'>To:</span></b>
dba-sqlserver@databaseadvisors.com<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [dba-SQLServer]Do
Loop in a sproc</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=blue face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:blue'>UPDATE tblPrintCharges
set ExceptionCode = left(ExceptionCode,len(ExceptionCode) - 1) WHERE
charindex(‘,’, ltrim(reverse(ExceptionCode))) > 0</span></font><span
class=EmailStyle20><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial'><o:p></o:p></span></font></span></p>
<p class=MsoNormal style='margin-left:.5in'><span class=EmailStyle20><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:
12.0pt;font-family:Arial'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></font></span></p>
<p class=MsoNormal style='margin-left:.5in'><span class=EmailStyle20><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:
12.0pt;font-family:Arial'><![if !supportEmptyParas]> <![endif]><o:p></o:p></span></font></span></p>
<p class=MsoNormal style='margin-left:1.0in'><font size=2 color=black
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;color:black'>-----Original
Message-----<br>
<b><span style='font-weight:bold'>From:</span></b> Chris McIsaac
[mailto:cjm@haleyaldrich.com]<br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, February 12, 2003
9:41 AM<br>
<b><span style='font-weight:bold'>To:</span></b>
dba-sqlserver@databaseadvisors.com<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [dba-SQLServer]Do
Loop in a sproc</span></font><font color=black><span style='color:black;
mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.0in'><font size=3 color=black
face="Times New Roman"><span style='font-size:12.0pt;color:black'><![if !supportEmptyParas]> <![endif]></span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.0in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>This is
what I was afraid of. In TSQL, there is something called a cursor that
allows you move through a set record by record, <br>
but the performance is horrible. A better way...</span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.0in'><font size=3 color=black
face="Times New Roman"><span style='font-size:12.0pt;color:black'> </span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.0in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'> UPDATE
tblPrintCharges set ExceptionCode = ExceptionCode + "18," where
EndServDate = '' <br>
UPDATE tblPrintCharges set ExceptionCode = ExceptionCode +
"19," where CPT = ''<br>
etc.</span></font><font color=black><span style='color:black;mso-color-alt:
windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.0in'><font size=3 color=black
face="Times New Roman"><span style='font-size:12.0pt;color:black'> </span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.0in'><font size=3 color=black
face="Times New Roman"><span style='font-size:12.0pt;color:black'><br>
</span></font><font size=2 color=blue face=Arial><span style='font-size:10.0pt;
font-family:Arial;color:blue'> -- trim the final comma<br>
UPDATE tblPrintCharges set ExceptionCode =
left(ExceptionCode,len(ExceptionCode) - 1) WHERE ExceptionCode IS NOT NULL AND
ExceptionCode <> ''</span></font><font color=black><span
style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.0in'><font size=3 color=black
face="Times New Roman"><span style='font-size:12.0pt;color:black'> </span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt;
margin-left:1.5in'><font size=2 color=black face=Tahoma><span style='font-size:
10.0pt;font-family:Tahoma;color:black'>-----Original Message-----<br>
<b><span style='font-weight:bold'>From:</span></b> Mark Boyd
[mailto:MarkBoyd@mcbeeassociates.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> 12 February 2003 10:18 AM<br>
<b><span style='font-weight:bold'>To:</span></b>
dba-sqlserver@databaseadvisors.com<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [dba-SQLServer]Do
Loop in a sproc</span></font><font color=black><span style='color:black;
mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=2 color=blue
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;color:blue'>Chris
–</span></font><font color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=2 color=blue
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;color:blue'>The
code is as follows.</span></font><font color=black><span style='color:black;
mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=2 color=blue
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;color:blue'>It was
written by another programmer about 7 years ago.</span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=2 color=blue
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;color:blue'>I’m
sure there is a better way to code this, but it needs to be finished by the end
of the day.</span></font><font color=black><span style='color:black;mso-color-alt:
windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=3 color=black
face="Times New Roman"><span style='font-size:12.0pt;color:black'> </span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>Set db
= CurrentDb()</span></font><font color=black><span style='color:black;
mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>Set
rstPrint = db.OpenRecordset("SELECT * FROM tblPrintCharges")</span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
If rstPrint.EOF = False Then</span></font><font color=black><span
style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
rstPrint.MoveFirst</span></font><font color=black><span style='color:black;
mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
Do Until rstPrint.EOF = True</span></font><font color=black><span
style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
Me.txtStatus = "Processing record '" & rstPrint!PatientNo &
"'"</span></font><font color=black><span style='color:black;
mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
Me.Repaint</span></font><font color=black><span style='color:black;mso-color-alt:
windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
If Nz(rstPrint!EndServDate) = "" Then</span></font><font color=black><span
style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
rstPrint.Edit</span></font><font color=black><span style='color:black;
mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
rstPrint!ExceptionCode = rstPrint!ExceptionCode & "18,"</span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
rstPrint.Update</span></font><font color=black><span style='color:black;
mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
End If</span></font><font color=black><span style='color:black;mso-color-alt:
windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
If Nz(rstPrint!CPT) = "" Then</span></font><font color=black><span
style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
rstPrint.Edit</span></font><font color=black><span style='color:black;
mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
rstPrint!ExceptionCode = rstPrint!ExceptionCode & "19,"</span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
rstPrint.Update</span></font><font color=black><span style='color:black;
mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
End If</span></font><font color=black><span style='color:black;mso-color-alt:
windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
If Nz(rstPrint!BegServDate) = "" Then</span></font><font color=black><span
style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
rstPrint.Edit</span></font><font color=black><span style='color:black;
mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
rstPrint!ExceptionCode = rstPrint!ExceptionCode & "20,"</span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
rstPrint.Update</span></font><font color=black><span style='color:black;
mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
End If</span></font><font color=black><span style='color:black;
mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
If Nz(rstPrint!Charge) = "" Then</span></font><font color=black><span
style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
rstPrint.Edit</span></font><font color=black><span style='color:black;
mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
rstPrint!ExceptionCode = rstPrint!ExceptionCode & "23,"</span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
rstPrint.Update</span></font><font color=black><span style='color:black;
mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
End If</span></font><font color=black><span style='color:black;mso-color-alt:
windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
rstPrint.MoveNext</span></font><font color=black><span style='color:black;
mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
Loop</span></font><font color=black><span style='color:black;mso-color-alt:
windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
Else</span></font><font color=black><span style='color:black;mso-color-alt:
windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
MsgBox "There are no outstanding charges.", vbCritical, "No
Charges"</span></font><font color=black><span style='color:black;
mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=1 color=blue
face=Tahoma><span style='font-size:8.0pt;font-family:Tahoma;color:blue'>
End If</span></font><font color=black><span style='color:black;mso-color-alt:
windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=3 color=black
face="Times New Roman"><span style='font-size:12.0pt;color:black'> </span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=2 color=blue
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;color:blue'>If I
use the format you suggest, how do I specify the WHILE (condition = true) without
setting the recordset?</span></font><font color=black><span style='color:black;
mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=2 color=blue
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;color:blue'>Can I
say WHILE tblPrintCharges.EOF = False … ?</span></font><font color=black><span
style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=3 color=black
face="Times New Roman"><span style='font-size:12.0pt;color:black'> </span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=2 color=blue
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;color:blue'>Thanks,</span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=2 color=blue
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;color:blue'>Mark</span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:1.5in'><font size=3 color=black
face="Times New Roman"><span style='font-size:12.0pt;color:black'> </span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=black
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;color:black'>-----Original
Message-----<br>
<b><span style='font-weight:bold'>From:</span></b> Chris McIsaac
[mailto:cjm@haleyaldrich.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, February 12, 2003
9:38 AM<br>
<b><span style='font-weight:bold'>To:</span></b>
dba-sqlserver@databaseadvisors.com<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [dba-SQLServer]Do
Loop in a sproc</span></font><font color=black><span style='color:black;
mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:2.0in'><font size=3 color=black
face="Times New Roman"><span style='font-size:12.0pt;color:black'> </span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>The
format is...</span></font><font color=black><span style='color:black;
mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:2.0in'><font size=3 color=black
face="Times New Roman"><span style='font-size:12.0pt;color:black'> </span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>WHILE
(condition = true)</span></font><font color=black><span style='color:black;
mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>BEGIN</span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:2.0in'><font size=3 color=black
face="Times New Roman"><span style='font-size:12.0pt;color:black'>
</span></font><font size=2 color=blue face=Arial><span style='font-size:10.0pt;
font-family:Arial;color:blue'>-- do processing</span></font><font color=black><span
style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:2.0in'><font size=3 color=black
face="Times New Roman"><span style='font-size:12.0pt;color:black'>
</span></font><font color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>END</span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:2.0in'><font size=3 color=black
face="Times New Roman"><span style='font-size:12.0pt;color:black'> </span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>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).</span></font><font color=black><span
style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:2.0in'><font size=3 color=black
face="Times New Roman"><span style='font-size:12.0pt;color:black'> </span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
12.0pt;margin-left:2.5in'><font size=2 color=black face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;color:black'>-----Original
Message-----<br>
<b><span style='font-weight:bold'>From:</span></b> Mark Boyd
[mailto:MarkBoyd@mcbeeassociates.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> 12 February 2003 9:26 AM<br>
<b><span style='font-weight:bold'>To:</span></b> SQLServerList<br>
<b><span style='font-weight:bold'>Subject:</span></b> [dba-SQLServer]Do Loop in
a sproc</span></font><font color=black><span style='color:black;mso-color-alt:
windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=black
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;color:black'>I am
converting VBA code to a stored procedure.</span></font><font color=black><span
style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=black
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;color:black'>This
code includes a pretty large Do Loop.</span></font><font color=black><span
style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=black
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;color:black'>Is it
possible to create a loop in a sproc?</span></font><font color=black><span
style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=black
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;color:black'>If
so, what is the format?</span></font><font color=black><span style='color:black;
mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:2.5in'><font size=3 color=black
face="Times New Roman"><span style='font-size:12.0pt;color:black'> </span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=black
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;color:black'>Thanks,</span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoAutoSig style='margin-left:2.5in'><font size=2 color=black
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;color:black'>Mark Boyd</span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoAutoSig style='margin-left:2.5in'><font size=2 color=black
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;color:black'>Sr.
Systems Analyst</span></font><font color=black><span style='color:black;
mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoAutoSig style='margin-left:2.5in'><font size=2 color=black
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;color:black'>McBee
Associates, Inc.</span></font><font color=black><span style='color:black;
mso-color-alt:windowtext'><o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:2.5in'><font size=3 color=black
face="Times New Roman"><span style='font-size:12.0pt;color:black'> </span></font><font
color=black><span style='color:black;mso-color-alt:windowtext'><o:p></o:p></span></font></p>
</div>
</body>
</html>