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
 General SQL Server Forums
 New to SQL Server Programming
 how to include ' in a string ?

Author  Topic 

jeff06
Posting Yak Master

166 Posts

Posted - 2007-02-22 : 14:35:02

select *
from dbo.RPT_ContractDetails
where businessname like '%carl's%'


carl's should be a string.
Thanks

X002548
Not Just a Number

15586 Posts

Posted - 2007-02-22 : 14:41:40
select *
from dbo.RPT_ContractDetails
where businessname like '%carl''s%'

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-02-23 : 01:00:25
that query will be slow if the table is large, as the wildcard on the front of the string prevents ay index on businessname from being used.


www.elsasoft.org
Go to Top of Page
   

- Advertisement -