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,206 of 19,505   
   Gene Wirchenko to esquel@sommarskog.se   
   Re: Stored Procedure Code Critique Reque   
   06 Apr 11 11:43:11   
   
   XPost: microsoft.public.sqlserver.programming   
   From: genew@ocis.net   
      
   On Wed, 6 Apr 2011 07:43:02 +0000 (UTC), Erland Sommarskog   
    wrote:   
      
   >Gene Wirchenko (genew@ocis.net) writes:   
   >>      I have finished writing my first involved stored procedure.  It   
   >> makes strings nice.  It works, but it might be better.   
   >>   
   >>      Have I, for example, missed out on functions that could have made   
   >> it easier?   
   >   
   >Kind of. While you can write this stuff in T-SQL, this is exactly why   
   >Microsoft added the capability to put code written in .Net in SQL Server.   
      
        I have not gotten into .Net.  One at a time.   
      
        What I am going to put on top of this is an insert/update trigger   
   to clean up strings.  Can I call .Net code from within a trigger?   
      
   >>      I also do not know how SQL Server handles multi-line values.  I   
   >> am assuming there is a CR (or UniCode equivalent) to delimit lines. In   
   >> case there could be LFs, I eliminate them in the line flagged   
   >> "--*****TRY".   
   >   
   >SQL Server does not really care much about lines at all. If you put CR-LF at   
   >the end of the string, there's a CR-LF at the end of the string. If string   
   >only has LF, that's it. Or only CR. It all depends on where the data comes   
   >from. If you load a text file from Unix, there will be only LF. If you   
   >run examples from SSMS there will probably be CR-LF, since SSMS in a Windows   
   >application.   
      
        Well, that could make things interesting in a cross-platform   
   situation.   
      
        SSMS does not display the multi-line values as such.  There is   
   space between the lines as in:   
             LINE ONE line two   
      
   >I do not have the time to look at the code as such for now.   
      
   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