Remove hidden characters in a column SQL SERVER

Posted on 2007-07-26
Last Modified: 2008-01-09
How do you remove hidden characters like a carriage return or any other unknown characters from columns?  
Question by:JulieGrace
    1 Comment
    LVL 142

    Accepted Solution

    each character has an ascii code, like carriage return and line feed have char(10) and char(13).
    so, simply do

    UPDATE yourtable
      SET yourcol = REPLACE(REPLACE(yourcol, char(13), ''), char(10), '')

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Introduction In my previous article ( I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
    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 videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
    Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

    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

    20 Experts available now in Live!

    Get 1:1 Help Now