Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with apostrophe

Status
Not open for further replies.

RicardoPereira

Programmer
Jun 3, 2003
255
PT
How do i select from my database a data with the ' character ?

I have a string (Ricardo's Pereira) in my database that has apostrophes. How should be my select statement to select strings with apostrophes in the middle?

Using "select * from teste where name='Ricardo's Pereira' " i got an error.

Any tip ?

Thanks
Ricardo

 
Use a double apostrophe.

select * from teste where name='Ricardo''s Pereira'

 
You might read about set quoted_identifier in Books online. There are implications for how you must then handle the use of literals in SQL statments, so it is best to read the explanation.

Questions about posting. See faq183-874
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top