escape sequence for varchar

escape sequence for varchar

Post by Rober » Sat, 17 May 2003 21:14:07



I need to insert text into a SQL Server Database and quite
often a single quote will be encountered such as
O'Reilly.  The insert fails at this point.  I was told to
use an escape sequence to overcome this but I am not
familiar with this process.  Can anyone help???

Thanks,

Robert

 
 
 

escape sequence for varchar

Post by Keith Kratochvi » Sat, 17 May 2003 21:19:36


Double up on the quote that you want to 'escape'

PRINT 'O''Reilly'

--
Keith, SQL Server MVP


> I need to insert text into a SQL Server Database and quite
> often a single quote will be encountered such as
> O'Reilly.  The insert fails at this point.  I was told to
> use an escape sequence to overcome this but I am not
> familiar with this process.  Can anyone help???

> Thanks,

> Robert


 
 
 

1. ODBC CALL escape sequence versus SQL_NOSCAN_ON

I can call my stored procedures (via ODBC) either using the ODBC CALL
escape sequence
    {call procedure(?,?,..?)}
or using the transact SQL
    execute procedure ?,?..?

the first one is recommended because they say is faster, but to use it i
must set the
SQL_NOSCAN option to SQL_NOSCAN_OFF, which in turn they say it affects
the performance as well...so which of the 2 evil things are better here?

thanks in advance

ionut

2. KS-Overland Park-279684--Mainframe-Client/Server-UNIX-Object Oriented Devel.-Dev

3. ODBC Escape Sequence and Outer Joins

4. NEWbie to TRIGGER

5. Escape Sequence

6. Newbie Data conversion question!

7. Escape sequence for return in a MEMO field

8. Run-Time Error "430"?

9. ODBC Escape Sequence

10. escape sequence

11. ODBC escape sequence

12. Escape sequence in T-SQL

13. escape sequence conflicting w/ backup (i.e. pg_dump)