all groups > sql server dts > march 2007 >
You're in the

sql server dts

group:

Trim trailing spaces


Trim trailing spaces Torrio
3/16/2007 8:19:36 AM
sql server dts:
Hello!!!
I am trying to build an SQL DTS Package which will export data from a table
to a text file. The table has only one column and it ALWAYS has data. No
nulls are allowed. The column length is 1500 but the data inserted are not
always of that length.
The issue is that when I export using DTS, I want the trailing spaces to be
trimmed off.
Is there any way to do it?
I tried using a query ("select rtrim(line) from wb_export) but I get the
error msg "The Data Pump Task requires Transformation to be specified"
Any ideas?

Thank you,

Re: Trim trailing spaces narayaana
3/27/2007 12:00:00 AM
I 'd say you are missing a colum name

[quoted text, click to view]

use: select line = rtrim(line) from wb_export

Re: Trim trailing spaces Torrio
3/27/2007 5:14:36 PM


[quoted text, click to view]
Thanks narayaana but this was not the only problem. Apart from that, I
should also use column delimited file instead of fixed length.
Thanks for your time

Re: Trim trailing spaces Allan Mitchell
3/27/2007 7:44:04 PM
Hello narayaana,

That's exactly right. Without an aliased column name here DTS has no idea
what we need.

select line = rtrim(line) as MyValue from wb_export

--

Allan Mitchell
http://wiki.sqlis.com | http://www.sqlis.com | http://www.sqldts.com |
http://www.konesans.com

[quoted text, click to view]

RE: Trim trailing spaces Thomas
4/1/2007 12:52:01 PM
Try www.sqlscripter.com to export data to text/csv.
It's free.


[quoted text, click to view]
RE: Trim trailing spaces Allan Mitchell
4/2/2007 8:10:25 PM
Hello Thomas,

The message you receive is most likely because you have not aliased the trimmed
column.

try

select rtrim(line) as TrimmedLine from wb_export

You can then map this column to a destination column.

--

Allan Mitchell
http://wiki.sqlis.com | http://www.sqlis.com | http://www.sqldts.com |
http://www.konesans.com

[quoted text, click to view]

AddThis Social Bookmark Button