Is there a Equivalent of Set Header OFF in MS SQL?

  • 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

  • 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

  • It is a stored Proc that is being called from a SQL Job.

    -Roy

  • 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

  • Writing to a file. Thats all.

    -Roy

  • 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?

  • 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

  • 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

  • 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

  • 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