Remove characters past 500 field length

  • Hi

    Sorry for the post but I have run out of ideas where to start.

    I'm have a client that has exported a file and part of this has a field length of near 2000 characters,

    whilst I can increase the import field to varchar(max) to get the export into the system, it then needs to update another table that has a field length of 500, and changing this will then have implications elsewhere.

    Therefore apart from telling the client to remove all characters past 500 on the data they export.

    I was looking at trying to remove all the text exceeding the 500 field length.

    Anyone able to help out.

  • Use the LEFT command keyword.

    ...

    SET shortColumn = LEFT(longColumn,500)

    ...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • Thanks very much for that it has done the trick.

  • I do have one question, is there data past 500 characters that the customer needs?

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

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