Jul 23, 2003 #1 takyan Programmer Oct 16, 2002 84 HK Hi, If the string contains single quotation mark, how can I search it using SQL?? E.g. the string is "o'clock", select * from table1 where code = 'o'clock' Please advise. Yan
Hi, If the string contains single quotation mark, how can I search it using SQL?? E.g. the string is "o'clock", select * from table1 where code = 'o'clock' Please advise. Yan
Jul 24, 2003 #2 SonOfEmidec1100 Technical User Aug 12, 2001 965 AU Two ways I know, replace the single quote with 2 single quotes select * from table1 where code = 'o''clock' or set quoted_identifier off select * from table1 where code = "o'clock" Have a look in BOL - Delimited Identifiers Upvote 0 Downvote
Two ways I know, replace the single quote with 2 single quotes select * from table1 where code = 'o''clock' or set quoted_identifier off select * from table1 where code = "o'clock" Have a look in BOL - Delimited Identifiers