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 2005 Forums
 SQL Server Administration (2005)
 sending sp output to textfile

Author  Topic 

Peter99
Constraint Violating Yak Guru

498 Posts

Posted - 2011-04-01 : 18:55:45
Hi,
I am trying to create job that will have three steps:
1. run script to create another script that will create login from one server.
2. run that script on another server to create sql statements that will create login script.
3. after second script, I want to transfer this text to a text files. So I can store somewhere to run in case of DR.

I tried SSIS. but after second step of executing sql statement, I cannot send output to text file. When I data flow task, I cannot do first task.

So my problem is how to send output from sp running through job to a text file.

Thanks

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-04-02 : 05:22:17
I prefer to use bcp if possible but you can use osql or sqlcmd (now) to run the sp.
Depends a bit on the format you need for the file and the code that's included in the sp.


==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -