Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #128

Re: Stored Procedure Code Critique Requested

From Erland Sommarskog <esquel@sommarskog.se>
Newsgroups comp.databases.ms-sqlserver, microsoft.public.sqlserver.programming
Subject Re: Stored Procedure Code Critique Requested
Date 2011-04-06 07:43 +0000
Organization Erland Sommarskog
Message-ID <Xns9EBF62D99BA9FYazorman@127.0.0.1> (permalink)
References <nk1np6tl9rthkh068vji35fpq34p7v21ff@4ax.com>

Cross-posted to 2 groups.

Show all headers | View raw


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 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.

I do not have the time to look at the code as such for now.

-- 
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Stored Procedure Code Critique Requested Gene Wirchenko <genew@ocis.net> - 2011-04-05 14:26 -0700
  Re: Stored Procedure Code Critique Requested Erland Sommarskog <esquel@sommarskog.se> - 2011-04-06 07:43 +0000
    Re: Stored Procedure Code Critique Requested Gene Wirchenko <genew@ocis.net> - 2011-04-06 11:43 -0700
      Re: Stored Procedure Code Critique Requested Erland Sommarskog <esquel@sommarskog.se> - 2011-04-06 23:58 +0200
  Re: Stored Procedure Code Critique Requested Henk van den Berg <hvandenberg@xs4all.nl> - 2011-04-06 21:15 +0200
    Re: Stored Procedure Code Critique Requested Gene Wirchenko <genew@ocis.net> - 2011-04-06 14:59 -0700
      Re: Stored Procedure Code Critique Requested Erland Sommarskog <esquel@sommarskog.se> - 2011-04-07 00:05 +0200
  Re: Stored Procedure Code Critique Requested Philipp Post <post.philipp@googlemail.com> - 2011-04-12 06:14 -0700

csiph-web