Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Writing to a text file without using xp_cmdShell

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-04-30 : 07:32:45
vittal writes "Hi

I have a requirement to write the output of a query to a text file. I know I can do this using the xm_cmdShell.

But this is something that would not go through my security audit.

So is there any other way of writing to a text file from a stored proc (without my having to use the xp_cmdShell)???

do you think sp_oa... would help?
or is there some other way???


thanks
Vittal"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-04-30 : 07:45:17
You can create a job that contains a CmdExec step that executes bcp to output the file. It doesn't use xp_cmdshell. You run the job using sp_start_job whenever you want to output the data to the file.

You can use sp_OA and object calls to write the file but it will probably be slower than bcp.

Go to Top of Page
   

- Advertisement -