Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trailing Spaces when Exporting as Delimited File

Status
Not open for further replies.

dpgirl

Technical User
Apr 5, 2005
45
US
I'm currently using SQL Server 2005. Sometimes, when I export a file in delimited format, there are trailing spaces included in some of the fields. Is that a bug? Doesn't exporting in delimited format normally trim the trailing spaces? If not, is there an easy way to trim every field without having to use the rtrim() command in front of every field in the select statement? (I sometimes have 20-30 fields and hate having to add a trim command for every field.)
 
Maybe you should trim the data in your database once and make sure it isn't put in again with trailing spaces or are you using char datatypes?

Exporting would never trim the data unless you tell it so. How does it know you don't want those spaces if you have them stored in the database? Either fix you data so it is properly stored without the spaces ro trim all the filed swhen you export.

"NOTHING is more important in a database than integrity." ESquared
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top