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 2008 Forums
 Other SQL Server 2008 Topics
 Query with ' -symbol in description

Author  Topic 

whaarhuis
Starting Member

2 Posts

Posted - 2011-04-13 : 07:41:36
I was wondering if it is possible to have a select query with the ' -symbol?

e.g.: 10 O'deel

You should state a query like:
select * from <table> where <column>='10 O'deel'

However, due to the ' in O'deel the query cannot be performed. SQL comes up with the error "Unclosed quotation mark after the character string ''."

In what way can I conduct this query?
(the column in question is varchar)

Thank you.

vaibhavktiwari83
Aged Yak Warrior

843 Posts

Posted - 2011-04-13 : 07:48:52
select * from <table> where <column>='10 O''deel'

Vaibhav T

If I cant go back, I want to go fast...
Go to Top of Page

whaarhuis
Starting Member

2 Posts

Posted - 2011-04-13 : 08:01:11
quote:
Originally posted by vaibhavktiwari83

select * from <table> where <column>='10 O''deel'

Vaibhav T

If I cant go back, I want to go fast...



THX. That worked!
Go to Top of Page

vaibhavktiwari83
Aged Yak Warrior

843 Posts

Posted - 2011-04-13 : 08:04:11
You are welcome

Vaibhav T

If I cant go back, I want to go fast...
Go to Top of Page
   

- Advertisement -