Unix Technical Forum

export data without trailing spaces

This is a discussion on export data without trailing spaces within the SQL Server forums, part of the Microsoft SQL Server category; --> Hello, when I export data from a table to a text file, I get trailing spaces if the data ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-29-2008, 06:14 AM
eddiekwang@hotmail.com
 
Posts: n/a
Default export data without trailing spaces

Hello,
when I export data from a table to a text file, I get trailing spaces
if the data type in char. (This dosen't happen if the data type is
varchar). I can get rid of the spaces by using the trim() function on
every signle column. here is an example:
DTSDestination("first_name") = DTSSource("last_name")

My question is:
Is there any easier way to get ride of the training spaces for all
columns when exporing a table? It is too time consuming if I have to
type trim() for every single column in the table.
Thank you in advance,
Eddy

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-29-2008, 06:14 AM
John Bell
 
Posts: n/a
Default Re: export data without trailing spaces

Hi

You can create a trim string transformation for the columns you wish to
trim. Depending on what currently have you may have to remove them from the
current transformation and create a new one.

John

<eddiekwang@hotmail.com> wrote in message
news:1103225990.307403.256040@c13g2000cwb.googlegr oups.com...
> Hello,
> when I export data from a table to a text file, I get trailing spaces
> if the data type in char. (This dosen't happen if the data type is
> varchar). I can get rid of the spaces by using the trim() function on
> every signle column. here is an example:
> DTSDestination("first_name") = DTSSource("last_name")
>
> My question is:
> Is there any easier way to get ride of the training spaces for all
> columns when exporing a table? It is too time consuming if I have to
> type trim() for every single column in the table.
> Thank you in advance,
> Eddy
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:49 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com