Spaces after data in field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HarryPotter79
    New Member
    • Feb 2008
    • 9

    Spaces after data in field

    Hi,

    I have used a bulk insert to fill a table as so.

    group unit name
    001 001 test1
    003 002 test2
    002 001 test33

    The table works fine however the name field has spaces after it ie "test1 ".

    I can get my query to return the correct by using rtrim(name) but would rather the insert didn't add the spaces in.

    the field id a char(10) because the name could be 10 characters long no more.

    the csv has no spaces in on a carrage return before the next record.

    I did do an update query to name = rtrim(name) but the spaces remain.

    Please help.

    Thanks Harry
  • Delerna
    Recognized Expert Top Contributor
    • Jan 2008
    • 1134

    #2
    Try changing the field type in the table to varchar(10)

    Comment

    • HarryPotter79
      New Member
      • Feb 2008
      • 9

      #3
      Thanks that worked a treat, but you know it would.

      Harry

      Comment

      • Delerna
        Recognized Expert Top Contributor
        • Jan 2008
        • 1134

        #4
        Your welcome and yes I knew it would. By the way I loved all of your books

        Comment

        Working...