Batch remove double quotes from a column in SQL?

Last post 08-29-2008 4:51 PM by xuanvu. 3 replies.

Sort Posts:

  • Batch remove double quotes from a column in SQL?

    08-29-2008, 1:29 PM
    • Member
      50 point Member
    • xuanvu
    • Member since 04-10-2007, 2:35 PM
    • Posts 299

     Hi all,

    I have a column in MS SQl database that have double quotes (") surround the texts, how do I batch remove all of them?

    Thanks,

    Kenny.

  • Re: Batch remove double quotes from a column in SQL?

    08-29-2008, 1:52 PM
    Answer
    • All-Star
      20,998 point All-Star
    • Jeev
    • Member since 11-24-2005, 12:49 PM
    • Posts 3,163

     use the replace function

    http://msdn.microsoft.com/en-us/library/ms186862.aspx

    Jeev
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    If you get the answer to your question, please mark it as the answer.
  • Re: Batch remove double quotes from a column in SQL?

    08-29-2008, 2:27 PM
    Answer
    • All-Star
      86,790 point All-Star
    • limno
    • Member since 06-10-2005, 7:50 PM
    • Iowa, USA
    • Posts 4,933
    • Moderator
      TrustedFriends-MVPs

    Without a WHERE clause, all values will be updated which is the remove of double quotes.

    UPDATE yourTableName SET col1= REPLACE( col1,'"','')

    Limno

    Format your SQL query with instant sql formatter:
    http://www.dpriver.com/pp/sqlformat.htm
  • Re: Batch remove double quotes from a column in SQL?

    08-29-2008, 4:51 PM
    • Member
      50 point Member
    • xuanvu
    • Member since 04-10-2007, 2:35 PM
    • Posts 299

     Thank you Jeev and Limno.

Page 1 of 1 (4 items)