Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have to update a column where I am giving query which is

Update Table 
Set col = '[189] IS NOT NULL and [189] <> ''' 
Where colid= 198

But it's giving output:- [189] IS NOT NULL and [189] <> '

I want output :- [189] IS NOT NULL and [189] <> ''

I am not getting single quotes at last. Please let me know how to give update query? Thanks in advance.

share|improve this question

1 Answer 1

For each single quote you want in a string constant, you need to use two to represent it

Two quotes in the string requires you to use 4 like this:

Update Table Set col = '[189] IS NOT NULL and [189] <> ''''' Where colid= 198
share|improve this answer
    
Thanks gbn for your quick reply....It works exactly as I wanted.. Thank you very much..... –  ramu May 16 '13 at 11:21
1  
@ramu if this solves your issue please consider accepting the answer by clicking the check mark on the left of the answer. –  JNK May 16 '13 at 12:27

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.