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


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

Re: Escape Characters in Strings

From Erland Sommarskog <esquel@sommarskog.se>
Newsgroups comp.databases.ms-sqlserver
Subject Re: Escape Characters in Strings
Date 2012-08-24 07:40 +0000
Organization Erland Sommarskog
Message-ID <XnsA0B96260D18C5Yazorman@127.0.0.1> (permalink)
References (3 earlier) <XnsA0B7D82775B60Yazorman@127.0.0.1> <n5ha38dbi03o3npmc3emukmisrb2qevl53@4ax.com> <k152pv$scc$1@dont-email.me> <XnsA0B8EC523442AYazorman@127.0.0.1> <k16agd$i9h$1@dont-email.me>

Show all headers | View raw


Bob Barrows (reb01501@NOSPAMyahoo.com) writes:
> Under the covers, a command object is created (similarly as to when the 
> connection's Execute method is called) and parameter objects are
> appended, typed based on that "best guess", which uses the types (or
> subtypes given vbscript's restriction to Variant datatypes) of the
> passed values in making that guess. Yes, theoretically, the best guess
> could be wrong, but in my experience it never has been - at worst, an
> implicit conversion might be required. Of course, my environment has
> always been very simple. And as long as you properly type your VB
> objects, the chance of a bad guess that requires more than a conversion
> from varchar to nvarchar, or float to integer is slim. 
 
The area that would make me the most worried are dates, particularly if you 
have them in string fields. If they are passed as (n)varchar, conversion 
happens in SQL Server which can give a headache.

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


Thread

Escape Characters in Strings Gene Wirchenko <genew@ocis.net> - 2012-08-21 15:39 -0700
  Re: Escape Characters in Strings Erland Sommarskog <esquel@sommarskog.se> - 2012-08-22 07:33 +0000
    Re: Escape Characters in Strings Gene Wirchenko <genew@ocis.net> - 2012-08-22 09:10 -0700
      Re: Escape Characters in Strings Erland Sommarskog <esquel@sommarskog.se> - 2012-08-22 21:14 +0200
        Re: Escape Characters in Strings Gene Wirchenko <genew@ocis.net> - 2012-08-22 13:53 -0700
          Re: Escape Characters in Strings Erland Sommarskog <esquel@sommarskog.se> - 2012-08-22 23:35 +0200
            Re: Escape Characters in Strings Gene Wirchenko <genew@ocis.net> - 2012-08-22 17:38 -0700
              Re: Escape Characters in Strings Erland Sommarskog <esquel@sommarskog.se> - 2012-08-23 10:22 +0000
          Re: Escape Characters in Strings "Bob Barrows" <reb01501@NOSPAMyahoo.com> - 2012-08-23 07:05 -0400
            Re: Escape Characters in Strings Erland Sommarskog <esquel@sommarskog.se> - 2012-08-23 23:13 +0200
              Re: Escape Characters in Strings "Bob Barrows" <reb01501@NOSPAMyahoo.com> - 2012-08-23 18:22 -0400
                Re: Escape Characters in Strings Erland Sommarskog <esquel@sommarskog.se> - 2012-08-24 07:40 +0000
                Re: Escape Characters in Strings "Bob Barrows" <reb01501@NOSPAMyahoo.com> - 2012-08-24 06:16 -0400

csiph-web