SQL Command - update

Posted on 2012-09-19
Last Modified: 2012-09-19
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?

Question by:kgerth
    LVL 15

    Accepted Solution

    UPDATE contact set mailto = 1 WHERE fullname = 'James O''Brien'
    LVL 25

    Expert Comment

    by:Lee Savidge
    UPDATE contact set mailto = 1 WHERE fullname = 'James O''Brien'

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
    Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
    This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
    Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now