How to remove leading space from sql server field

Posted on 2006-04-27
Last Modified: 2012-06-21
Is it possible to remove the leading space from a sql server field?  I did a DTS into a table and it has put a space in front of the field.
An update script would be appreciated.
Question by:EugeneC
    LVL 75

    Expert Comment

    by:Aneesh Retnakaran
    u can use RTRIM(urField)
    LVL 75

    Accepted Solution

    LTRIM(urField ) will remover the spaces from the beginning

    UPDATE urTable
    SET urColumn = RTRIM(LTRUIM(urColumn))
    LVL 20

    Expert Comment


    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    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…
    For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
    Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
    Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

    729 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