Groups | Blog | Home
all groups > sql server dts > october 2005 >

sql server dts : Export Variable length field


SQL
10/21/2005 1:37:06 PM
use the left and/or substring functions

http://sqlservercode.blogspot.com/

[quoted text, click to view]
Stephen Costanzo
10/21/2005 4:18:56 PM
I have a package set up to export a single column in a table, this column
is varchar(4096). The output from the package is a fixed width field of
4096. My goal is to export lines of various lengths (10, 200, 1500, 200). Is
this possible?

I have found many referenced to reading a variable length using DTS but not
one on exporting.

Thanks in advance


Stephen Costanzo
10/21/2005 5:36:41 PM
The problem with this is, I don't know the correct length of each of the
rows in the table. Some are 10, some are 200. They are written to the
varchar field correctly as that length. It is the export that fails.
Additionally, I cannot RTRIM the field as the last 5 characters of that 200
record can be spaces. Therefore the record would be incorrectly truncated to
195 characters as opposed to 200 characters.

These values are going to an old mainframe system where it reads the first 5
characters of the line, knows the type of information and expects (based
upon its information) a certain number of characters after the first 5.
Therefore if we send 195 as opposed to 200, the mainframe process will
terminate due to a record length failure.

[quoted text, click to view]

Allan Mitchell
10/22/2005 3:20:58 AM
Hello Stephen,

I am unsure as to what you need here.


Do you have a variable width column in a table and want to export at a fixed
width value of 4096?
Do you have a 4096 length column and you want to export to varying widths
of column (10,200,1500)?


If you can show us a before and after this would help.

Thanks

Allan



[quoted text, click to view]

AddThis Social Bookmark Button