Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sql server 2008 - French words break the string

I have french word like "Services d'organisation de séminaires" and I want to search word in SQL SERVER 2008. But the main problem is SQL SERVER give an Error because of string break.

Msg 102, Level 15, State 1, Line 1 Incorrect syntax near 'organisation'

can anyone have idea about this? My table stores french words.

like image 395
user3090790 Avatar asked Feb 05 '26 23:02

user3090790


2 Answers

The apostrophe in d'organisation teminates the String literal in your query (apostophe is the standard delimiter), so you have to escape it by doubling it: d''organisation.

like image 108
piet.t Avatar answered Feb 07 '26 16:02

piet.t


You should escape those single quotes. You can double them or use char(39).

Services d''organisation de séminaires

or

'Services d'+char(39)+'organisation de séminaires'
like image 22
Kuzgun Avatar answered Feb 07 '26 15:02

Kuzgun