Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
add comment

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.

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
add comment

Your Answer

 
discard

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.