SQL Command - update

I need to be able to update my SQL DB where the WHERE statement contains personal name such as James O'Brien. If I write the update statement as
UPDATE contact set mailto = 1 WHERE fullname = 'James O'Brien'
it will not work because of the ' in the name. How can I get around this? Is there a different syntext I can use?

Thanks
kgerthAsked:
Who is Participating?
 
AnujSQL Server DBACommented:
UPDATE contact set mailto = 1 WHERE fullname = 'James O''Brien'
0
 
Lee SavidgeCommented:
UPDATE contact set mailto = 1 WHERE fullname = 'James O''Brien'
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.