Removing words and spaces using DTS

  • I have a table of addresses I need to import each month and under the

    'County' Column the word County or Borough follows each county name. Ex

    'Baltimore County', 'Washington County', 'Davis Borough' etc.

    Using DTS is there a way to remove the space and County(Borough) following

    each county name?  I've tried using the trim feature but that only seems the

    Trim the White Space.

    Thanks for any help you can offer.

  • If you're using a transform data task you could always hit the source SQL with something like:

    RTRIM(REPLACE(REPLACE(County,'County',''),'Borough','')) AS County



    Everett Wilson
    ewilson10@yahoo.com

  • I used the following code successfully:
     
    UPDATE TableName

    SET County = (REPLACE(REPLACE(County,' County',''),' Borough',''))

    GO

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply