🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.databases.ms-sqlserver
2 messages
2 total messages Started by Tom Wed, 22 Jul 1998 00:00
*&$^&%$ Double and single quote in same string
#146
Author: Tom
Date: Wed, 22 Jul 1998 00:00
12 lines
1388 bytes
In a stored procedure I am building a dynamic string to be executed.  One of
the variables that is in the where statement has a double and a single quote
in it.  In order to execute my string I need to place it in either single or
double quotes but this will bomb if there are both in the string.  In oracle
and Informix they have escape characters to get around this.

Does SQL Server have some type of escape character to get around this.  Or
is there some other type of work around.

Thanks

Tom
Re: *&$^&%$ Double and single quote in same string
#147
Author: Godzilla
Date: Wed, 22 Jul 1998 00:00
25 lines
1650 bytes
On Wed, 22 Jul 1998 15:55:18 -0400, "Tom" <somewhere@nospam.com>
wrote:

>In a stored procedure I am building a dynamic string to be executed.  One of
>the variables that is in the where statement has a double and a single quote
>in it.  In order to execute my string I need to place it in either single or
>double quotes but this will bomb if there are both in the string.  In oracle
>and Informix they have escape characters to get around this.
>
>Does SQL Server have some type of escape character to get around this.  Or
>is there some other type of work around.
>
>Thanks
>
>Tom
>
>

to hell with ecape characters.  double up where you want it to .
these work

select "O'Hara said ""Quote this, Batman"""
select 'O''Hara said "Quote this, Batman"'

paste this into wISQL, its a bit more readable there
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads