home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 18,209 of 19,505   
   Gene Wirchenko to hvandenberg@xs4all.nl   
   Re: Stored Procedure Code Critique Reque   
   06 Apr 11 14:59:10   
   
   XPost: microsoft.public.sqlserver.programming   
   From: genew@ocis.net   
      
   On Wed, 06 Apr 2011 21:15:48 +0200, Henk van den Berg   
    wrote:   
      
   >On 05-04-2011 23:26, Gene Wirchenko wrote:   
   >> Dear SQLers:   
   >>   
   >>       I have finished writing my first involved stored procedure.  It   
   >> makes strings nice.  It works, but it might be better.   
   >>   
   >One thing I recommend is to always use BEGIN/END after an IF/WHILE, even   
   >if there's only one statement to execute, see below.   
      
        I do not like the clutter.  To guard against the risk you imply   
   (and it is a valid concern), instead, I am VERY fussy with indentation   
   as in, in C:   
             for (i=1; i<=10000; i++)   
                ;     /* empty body */   
      
   >>        -- Add back any leading or trailing spaces being kept.   
   >>        if @fTrimLead=0   
   >>           select @strLine=space(@cLeading)+@strLine   
   >>        if @fTrimTrail=0   
   >>           select @strLine=@strLine+space(@cTrailing)   
      
   Sincerely,   
      
   Gene Wirchenko   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca