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.
| Author |
Topic |
|
tbrothers
Yak Posting Veteran
83 Posts |
Posted - 2008-07-17 : 16:36:44
|
| Hi:Is there a way to automate the process of running a query and saving the result to a file? I've setup log shipping but I'll also need the current SQL Logins in case the production server decides to takes a permanent nap.I want to run the following script and save the output to a file.EXEC sp_help_revloginThanks,Terry |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-07-17 : 16:41:13
|
quote: Originally posted by tbrothers Hi:Is there a way to automate the process of running a query and saving the result to a file? I've setup log shipping but I'll also need the current SQL Logins in case the production server decides to takes a permanent nap.I want to run the following script and save the output to a file.EXEC sp_help_revloginThanks,Terry
If you backup master database and model database regularly, you don't have to be worried about jobs and logins. |
 |
|
|
tbrothers
Yak Posting Veteran
83 Posts |
Posted - 2008-07-17 : 18:07:15
|
| I perform full backups of all databases every night.Our production server and our backup server have different names and I'm sure there are slight differences in them. We log ship every 15 minutes. If the prod server fails it's a matter of running a script on each database to take it out of read-only mode.If I restored the master database to the backup server, different name and maybe slight configuration differences, wouldn't that cause a problem?Thanks,Terry |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
tbrothers
Yak Posting Veteran
83 Posts |
Posted - 2008-07-17 : 18:38:27
|
| Thanks Tara:Can the script be automated to run nightly or weekly?Thanks,Terry |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-07-17 : 18:46:37
|
| Yes. I'd suggest wrapping it into a stored procedure and then just calling the stored procedure from the job step. You could just put my script into the job step, but I prefer to have as little code in jobs for troubleshooting reasons.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
 |
|
|
|
|
|