Link to home
Start Free TrialLog in
Avatar of jeebee75
jeebee75Flag for New Caledonia

asked on

Define field lengths for MS SQL 2000 DTS bulk export to text file

Hi,

i try to prepare an export of an SQL query into a text file which fields should be of a delimited lenght. The file should be like (the export has 2 fields and if field1 is 10 char and field2 is 8 char):
field1....field2..field1b...field2b. (where points are spaces in the example).

I thought doing this with the SQL 2000 DTS Bulk export bue i don't know where to set the fields length.

Thanks for your help.
 
Avatar of James Murrell
James Murrell
Flag of United Kingdom of Great Britain and Northern Ireland image

You do not define the lengths when using a delimited format.  That is the whole point of delimited files.

If I am not understanding, than please indicate what is the current output and the desired output.
ASKER CERTIFIED SOLUTION
Avatar of Brendt Hess
Brendt Hess
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jeebee75

ASKER

Thanks for your posts.
Each record of the output file should be 372 char length. There should be no delimiter between the fields but blanks to complete each field length:

Field      Type      Position      Length
a      char      1      5
b      char      6      6
c      char      12      9
d      char      21      50
e      char      71      50
f      char      121      3
g      char      124      50
h      char      174      50
i      char      224      5
j      char      229      10
k      char      239      10
l      char      249      10
m      char      259      50
n      char      309      13
o      char      322      50

Thanks for your help

I found the solution. I had to use the "define columns" (and specify each field length) in the transform data task and choose <none> for the row delimiter as bhess1 told me.

Thanks for your help