jeebee75
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.
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.
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.
this might help http://www.microsoft.com/technet/prodtechnol/sql/2000/books/c07ppcsq.mspx
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.
If I am not understanding, than please indicate what is the current output and the desired output.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
ASKER
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
Thanks for your help