![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 |
#3
| |||
| |||
|
|
use the left and/or substring functions http://sqlservercode.blogspot.com/ "Stephen Costanzo" wrote: 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 |
#4
| |||
| |||
|
|
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. "SQL" <SQL (AT) discussions (DOT) microsoft.com> wrote in message news:89B8BB24-14B2-483C-9F21-5064345029DC (AT) microsoft (DOT) com... use the left and/or substring functions http://sqlservercode.blogspot.com/ "Stephen Costanzo" wrote: 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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |