Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Removing header line from Txt file

Author  Topic 

icebo3
Starting Member

20 Posts

Posted - 2004-07-26 : 03:36:20
i use isqlw command to run a schedule batch file. in the output of the txt is the header, header's line and data. how do i remove the header line?

Kristen
Test

22859 Posts

Posted - 2004-07-26 : 04:19:26
Tools : Options : Results : Print column headers
Go to Top of Page

icebo3
Starting Member

20 Posts

Posted - 2004-07-26 : 04:31:50
can i maintain the header but without the header line as my report is schdule run and will be populate to a location. My iser will use Access to open the file.

Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2004-07-26 : 05:16:02
You mean you want to output it to a file so you can import it into Access? if so:

Tools : Options : Results :

results target = "Results to file"
output format = "TAB delimited"
print column headers = "Checked"

But you would be better off using DTS I expect.

Kristen
Go to Top of Page

icebo3
Starting Member

20 Posts

Posted - 2004-07-26 : 20:19:32
what about the header line?? will it be shown there... if it is there, meaning the user need to filter the line (-----)
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-07-26 : 20:26:08
Why are you using isqlw to create a file? You should be using bcp or DTS for this. You then schedule that command. I would pick bcp over DTS.

Tara
Go to Top of Page

icebo3
Starting Member

20 Posts

Posted - 2004-07-29 : 23:26:17
i have not use bcp or dts before... actually i don't about it... can u show me how..

i use isqlw because i run a batch and the batch will have the command isqlw to excute my sql command.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2004-07-30 : 01:38:24
ah, OK. I thought you were doing it manually. Is it just the one batch, or do you have several (or will you have several in the future?) If you are going to have several better to get some skills with DTS or BCP, otherwise I suggest you use OSQL innstead of ISQLW.

DTS has a whole set of visual tools to enable "jobs" to be built.

BCP is a command line tool for import/export of data in a variety of formats. Its very fast for large amounts of data, but pretty user-hostile to set up! (Mind you, if you are already using ISQLW from command line then you won't find it much different)

Have a look in Books Online for some information.

Kristen
Go to Top of Page

icebo3
Starting Member

20 Posts

Posted - 2004-08-04 : 04:36:15
Kristen,

yes, i schedule the report use batch file and isqlw command. i try in the query analyzer - Tools : Options : Results :

results target = "Results to file"
output format = "Comma delimited"

and i will be able to remove the header line and my user love this format and he want it to seperate by comma...

my problem is my other report is using the option "Tab Delimited" so i can't change the option from tab to comma just to cater for one comma delimited report... any suggestion?
Go to Top of Page
   

- Advertisement -