Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTS - Tab Delimited Header Question

Status
Not open for further replies.

jayfox

Programmer
Dec 19, 2002
29
0
0
US
I have a query that needs to be exported to a tab delimited file it alson needs to include the column headers. Everything is fine until I found out I need to include a header everytime which also needs to be tab delimited. How can I go about doing this with a DTS.
Should I go about it a different way.

EX:

This is a test
ID NAME
1 Smith
2 Jones
 
ok Didn't get your question clearly but will try to answer if you need that.

When you start a DTS Package, select that import from the options:

it will ask you the source file select text file at the bottom and locate the file wherever it is. After that it would give you some options click include first row as header and selected "delimeted" instead of "fixed fields" and click next, it would give some more options for the delimeter, if you don't see a tab option than click on other and press tab. After that next step would be selecting the destination and locating the destination. I guess than onwards you would be good. If any more questions feel free to ask.

Ashish Smith
 
I understand how to create the DTS my problem is getting the header record to be included in my text file every time I run the DTS.
Would I have to create a seperate table that holds my header record than insert my results into this table. Then execute the DTS?
 
ok so do you drop the table each time you run the DTS Package, if not than you have your fields.

and if the fields are set than you don't need the first line as the headers, just delete the first line from your text file thats it and deselect "First row as headers" from your DTS package. if you have this file automatically created and you will have to manually delete the first row always than better write a code to delete first line from your text file each time when the text is created. I did the same thing to delete the first line from my text which is getting imported to my sql table by my DTS Package and i am executing my code before my DTS package to get that first line erased before DTS Package handles it for the operation, you can run both of them by a batch file thats it you are done than.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top