December 4, 2003 at 3:27 am
I wrote a stored procedure that returns information in a specific format. Is there any way to save the XML stream in SQL automatically to a file with a certain name. Any help would be greatly appreciated.
Patrick Quinn
TRMS Database Administrator
December 5, 2003 at 10:58 am
You may want to try using an OSQL window to run the SP, then redirect the output to a file.
for example:
execute('MASTER.DBO.XP_CMDSHELL ''OSQL -U UserName -P ' -|- @PASSWORD -|- ' -Q "EXECUTE DataBase.DBO.SP_Name " -w116 -o' -|- @LOCATIONOFOUTPUTFOLDER -|- '\OutputFilename.TXT''')
note -|- is a plus sign, but the forum interface keeps deleting them.
December 8, 2003 at 8:26 am
Well, that will work. However, I am getting this error message below.
Cannot open output file - c:\xml\mscunits.xml
No such file or directory
The file and directory structure exists on the machine that QA is running. Is there something with xp_cmdshell or QA that needs to be modified in order to get it to execute and create the output file in the c:\xml directory?
Patrick Quinn
TRMS Database Administrator
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply