January 23, 2012 at 8:45 am
We don't have SSIS installed so is there any way a Job can be run to direct the output from an executed sp to a text file on a fileshare?
January 23, 2012 at 9:25 am
Random Visitor (1/23/2012)
We don't have SSIS installed so is there any way a Job can be run to direct the output from an executed sp to a text file on a fileshare?
There's a couple of ways I can think of, but it depends on your situation.
Can you install a CLR? that would be my best recommendation; it depends on whether you are writing a string, or if you need to write a resultset into a file in some specified format as well.
If you are allowed to have xp_CmdShell enabled, you can do it via bcp or direct command line calls.
if you can give a little more information about your requirement as to what data, and what kind of data, and what the expected format is, we can help you better.
Lowell
January 23, 2012 at 9:32 am
Hi thanks for your interest.
It's a fairly straightforward query that the sp is running to select some data from a single table. I want to be able to output the data in a 'Results to file' type format onto a shared drive. If teh data could be written to a .csv file with column headers and data delimited by commas so much the better. It needs to be scheduled though to run daily. Simple to do with the old 2000 DTS packages not so easy without SSIS in 2005 🙁
January 23, 2012 at 8:51 pm
Open the job that contains the command to run the SP. Go to the step that executes the SP then in the top left corner you will see the 'ADVANCED' tab. Click that tab and you will see an option to select an 'Output file' for that job step. If the SP is going to spit some results then those results will get saved in that file.
Blog
http://saveadba.blogspot.com/
January 24, 2012 at 5:34 am
Hey thanks - I never even noticed that tab before 🙂 Problem solved.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply