Hi,
hopefully someone can offer some sense on this - I am wanting to extract the results of 2 seperate queries into one txt file.
However the results in the txt file need to retain their specific field lengths.
The file is essentially a buildup of an order file which has line 1 = header information, and line 2+ = line items on the order. Finally the 3rd line is just a sum of the quantities in the line items.
I had thought about putting all this information into the one table and exporting the contents, however the field lengths are different on each line so this idea wouldn't work - as these field lengths need to be retained as they will form part of the structure of the fixed width delimited txt file.
I have been given the options of merging the 2 files using DOS however I have also been informed that this can introduce some unreliable results - which cannot be handled where this file is going.
Another option is bcp - which at this stage, seems to be the only realistic option - however I was interested to see if others confirmed that this is the only/best way, or whether there is something else which might be better suited.
Hopefully I have given enough information on what I am trying to achieve - if I need to offer more detail, please let me know.
Thanks in advance for your assistance on this.
Regards
Troy
hopefully someone can offer some sense on this - I am wanting to extract the results of 2 seperate queries into one txt file.
However the results in the txt file need to retain their specific field lengths.
The file is essentially a buildup of an order file which has line 1 = header information, and line 2+ = line items on the order. Finally the 3rd line is just a sum of the quantities in the line items.
I had thought about putting all this information into the one table and exporting the contents, however the field lengths are different on each line so this idea wouldn't work - as these field lengths need to be retained as they will form part of the structure of the fixed width delimited txt file.
I have been given the options of merging the 2 files using DOS however I have also been informed that this can introduce some unreliable results - which cannot be handled where this file is going.
Another option is bcp - which at this stage, seems to be the only realistic option - however I was interested to see if others confirmed that this is the only/best way, or whether there is something else which might be better suited.
Hopefully I have given enough information on what I am trying to achieve - if I need to offer more detail, please let me know.
Thanks in advance for your assistance on this.
Regards
Troy