By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,716 Members | 1,296 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,716 IT Pros & Developers. It's quick & easy.

Spaces after data in field

P: 9
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
Feb 25 '08 #1
Share this Question
Share on Google+
3 Replies


Delerna
Expert 100+
P: 1,134
Try changing the field type in the table to varchar(10)
Feb 26 '08 #2

P: 9
Thanks that worked a treat, but you know it would.

Harry
Feb 26 '08 #3

Delerna
Expert 100+
P: 1,134
Your welcome and yes I knew it would. By the way I loved all of your books
Feb 26 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.