September 14, 2005 at 7:44 pm
I am running a job from within enterprise manager, SQL agent. This is a job type of Transact-Sql Script. Basically the job executes a simple SQL query and it then writes it out to a file using the "Output file" option from the advanced options of the job definition.
My problem is that the output file has a header in it which includes the job name and the create date/time. Instead, I just need the raw output from the query without any headers.
Any ideas? I have very little SQL experience so any solid explanations would be very appreciated. Thank you for your help!
September 15, 2005 at 5:11 am
Anyone? Any ideas
September 16, 2005 at 6:50 am
Change the type to Operating System Command and execute the query using -osql command. I learned this technique after searching the web for monitoring scripts.
September 16, 2005 at 7:18 am
How do I execute as an O-sql command. Is this still from within the SQL agent scheduler?
September 16, 2005 at 7:26 am
How do I execute as an O-sql command. Is this still from within the SQL agent scheduler?
September 16, 2005 at 7:27 am
I found a command called "Set heading off" but this looks to be a SQL plus command and it is showing as an invalid command when I run my SQL query.
Any ideas on another form of this command for non-sql plus?
September 16, 2005 at 7:44 am
The osql utility is described in Books Online. Example:
osql -E -Sservername -Q"query"
When you create a job step, it normally defaults to T-SQL. When you edit a job step, change the type to Operating System Command on the General tab.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy