Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to insert the following message:

friend's mobile number

from a file over redhat server into sql server 2005.
this message is appearing in the sql server as below:

friend s mobile number

where the apostrophe is appearing as a space, I tried different escape characters but still didn't work.

How can I fix this?

share|improve this question

Try "friend''s mobile number"

Note the double-apostrophe, that's how you escape an apostrophe in most (if not all) dialects of SQL, including MS SQL.

If that doesn't work, then I'd suspect that your application or your sql library is buggy and doing things it shouldn't.

share|improve this answer
Its not working – bob Sep 20 '12 at 13:11
"it's not working" isn't much of a problem description. try adding more details to your question, including: what programming language you're using, what library and version you're using to connect with the MS SQL server, and a small self-contained code sample that demonstrates the problem. – cas Sep 20 '12 at 14:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.