SQLTeam.com | Weblogs | Forums

Csv from SQL query and column widths


I am trying to create a fixed width file from the result of a SQL query using the SQL Server Import and Export Wizard. The problem I am running into is this:
I have to have a section at the top of the page that lists many 4 digit codes that corresponds to the data from the query. For example:


01/01/63 9073730000 1234 S STREET CIR WASILLA, AK 99654 0000 01 M 9070000000 001BOB Q PICKLES 00008880555 000000000 098460002245.000002245.00 001

There are gaps in the data because each field is a fixed width. So...question is, how do I keep the 4 digit codes at the top but have the up to date data under it? I thought I would be able to create a txt file and have the 4 digit codes at the top and just append the results from the query but each record needs to have the codes and the codes very rarely change.

4 digit codes
Record 1 data
4 digit codes
Record 2 data

I hope this makes sense....

thank you