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
 SQL Server Development (2000)
 Problem with quotes

Author  Topic 

pattikay
Starting Member

36 Posts

Posted - 2001-07-10 : 11:14:28
I would like to return matches that have been stored with quotes ,
either single quotes or double quotes
when i run the following queries i get correct matches :

select not_noteid from notes where not_text like "%'sick'%"
select not_noteid from notes where not_text = "'sick'"

but when a stored procedure executes the following it gets the following error:
Incorrect syntax near 'sick'.

the string the stored procedure executes looks like this :

select atd_id
from attendance_details
where
attendance_details.atd_complaintid in(select not_noteid from notes where not_text like "%'sick'%")

The stored procedure uses sp_executesql to execute that statement.

Thanks In advance.






Edited by - pattikay on 07/10/2001 11:17:07
   

- Advertisement -