Question : Escaping Characters in a SQl Server 2008 Script

Hi

I want to so a search throughout my stored procedures for the string  'CancelConfirm' ie with the single quotes included.

Using this script:

usp_Find 'CancelConfirm'

I was able to look for the string without the single quotes but that is not exactly what I want.

How do I correct this?

Regards,

Asha.

Answer : Escaping Characters in a SQl Server 2008 Script

To escape the single quote, add a second single quote.  In the tests I've run, I've had to enclose the whole string, including escaped quotes, in real single quotes.  I would try surrounding the CancelConfirm string with three single quotes:

usp_Find '''CancelConfirm'''
Random Solutions  
 
programming4us programming4us