Data import / export issue

  • I have a database with an address field that is listed as varchar(50). I have to import this data into a flat file, fixed width, of a length of 30. The requirements restrict it to 30, no more.

    The issue I have is how do I trim the varchar(50) address field to fit a length of 30?

    Isn't there a TRIM command that could do this or I am wrong? Losing data doesn't really matter in this case I just need to know how to do it.

  • Trim would just trim the spaces. You can use a derived colum with Substring funciton on your address field OR you can use Substring function in you source query

    Derived Column

    SUBSTRING( [Address] , 1,30 )

    HTH

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

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