Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 300
  • Last Modified:

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
0
kgerth
Asked:
kgerth
1 Solution
 
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now