Need a query to scrub tick marks from string

Posted on 2009-04-21
Last Modified: 2012-05-06
I am working in sql server 2005 and I have a field in a table that has a datatype of varchar. In that field every now and then I get data that has either a leading tick(') mark or a trailing tick mark('). I need a query that allows me to lcate these fields,remove the tick mark,and update the field with the same data minus the tick mark.

order_nbr = 3400481`(tick mark located at end of string)
Question by:frogman22
    LVL 22

    Accepted Solution

    UPDATE yourtable
    SET order_nbr = REPLACE(order_nbr, '''','');

    Author Closing Comment

    Thats it. Thank You!!

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
    INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

    754 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

    18 Experts available now in Live!

    Get 1:1 Help Now