Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 single quote ' in string

Author  Topic 

JAdauto
Posting Yak Master

160 Posts

Posted - 2006-02-16 : 22:52:49
I have a query that, simplified, would look like this:

SELECT *
FROM Event e
WHERE e.EventName = 'Hanna's Wedding'

You can probably see my issue. Hanna's Wedding is my search criterea, but it might not always be Hanna's Wedding. It could be Commitee brunch, without a ' or it could be Jack's Bday with one. I have done searches and seen lots of stuff on single quotes, but maybe I am missing the solution somewhere. I dont know how to make it match that data.

thanks again,
JAdauto

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2006-02-16 : 23:01:06
you need to double up the imbedded single quote: 'Hanna''s Wedding' (that's two single quotes)

Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -