April 2, 2008 at 12:11 pm
Hi ALl,
I have a job that write the output of a query to a flat file. It works fine. But I dont want the column names to appear in the output file. In Oracle, if I am not mistaken, there is an option like Set header off. (It has been years since I did anything with Oracle). Is there anything like that in MS SQL?
Thanks
Roy
-Roy
April 3, 2008 at 12:08 pm
Are you using a proc to write the output file, or an SSIS package, or something else?
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 3, 2008 at 12:11 pm
It is a stored Proc that is being called from a SQL Job.
-Roy
April 3, 2008 at 12:15 pm
Shouldn't have row headers in that case. What's the output method?
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 3, 2008 at 12:29 pm
Writing to a file. Thats all.
-Roy
April 3, 2008 at 12:31 pm
Roy Ernest (4/3/2008)
Writing to a file. Thats all.
How as in what command is being used to output to the file? BCP? OPENROWSET?
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
April 3, 2008 at 12:40 pm
If you are setting this as a Job, you can just use the Tool itself to say to write to a file. In the Job Step Properties, there is an advanced properties for that. There you can Browse and say where you want to write it and what file name you want to write it to. Also you can either Append the existing file or recreate the file every time.
-Roy
April 3, 2008 at 1:27 pm
Ah. No, I don't think there's an option for leaving out the headers in that case.
That whole option is just a sort of crippled SSIS wizard. It builds the package for you, but without most of the options you would have if you build it yourself. It's like the Import/Export wizards.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 3, 2008 at 1:32 pm
Darn... At least is there a work around without me having to write an app that will connect to DB and then open a file and write it?
-Roy
April 3, 2008 at 1:41 pm
I think openrowset will do what you need.
Otherwise, a simple SSIS package definitely will. Shouldn't take more than a few minutes to build and test.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply