SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Old Forums
 CLOSED - General SQL Server
 How to escape apostrophe?
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

yyc
Starting Member

5 Posts

Posted - 05/18/2005 :  10:00:34  Show Profile
I want to search a phrase such as dog's which contains the special character but I find no way to escape it.

I use the following sql,

select title from book where title like '%dog's%'

but it does not work. Any suggestion? Thanks.

yyc

TG
Flowing Fount of Yak Knowledge

USA
6062 Posts

Posted - 05/18/2005 :  10:04:01  Show Profile
2 single quotes instead of one. ie: '%dog''s%'

Be One with the Optimizer
TG
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22765 Posts

Posted - 05/18/2005 :  10:05:28  Show Profile  Send madhivanan a Yahoo! Message
Try this

select title from book where title like '%dog''s%'


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

yyc
Starting Member

5 Posts

Posted - 05/18/2005 :  12:32:30  Show Profile
Oh thanks a lot guys! I have surf to countless site using google but I can't get a way to solve the problem. The suggestion from both of you really great, thanks again!

yyc
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000