11-28-06, 10:31 #1Registered User
- Join Date
- Mar 2004
Unanswered: Question on db maintenance scripts
Relatively new to SQL Server, running both 2000 and 2005.
I have to set up database maintenance scripts, db and log backups, optimizations etc in batch files so that they can be run by an external scheduler.
When I produce a script from the SQL Server database maintenance wizards and save it off in a bat file, the script will not work when run manually, probably due to the difference in syntax.
I have some examples of backup scripts using sqlmaint.exe, but can't find anything on how to script optimization/reorg jobs so that they can be run by an external scheduler.
Can anybody point me to any docs or guidance on how to produce backup and reorg scripts that can be run externally?
Thanks in advance.
11-28-06, 10:40 #29th inning DBA
- Join Date
- Jan 2004
- In a large office with bad lighting
It sounds like you want to use the osql utility. Go to BOL and look it up uner the index tab. When you double-click on the index utility, chose the "osql utility" under the Command Pronpt Utilities.
-- This is all just a Figment of my Imagination --