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?

1 Answer 1


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.

  • Its not working
    – WAEL
    Sep 20, 2012 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, 2012 at 14:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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