SQL Server Maintenance Driver

This DOS utility will initiate and log the results of maintenance for some or all of the databases on the SQL Server. Here is an alternate script that includes the database dumps in the batch process.



@echo off
cls

rem Do some basic stuff to validate the command line
rem verify that two arguments are given
  if "%2" == ""  goto :badcall

rem enter a call for each database to be maintained on the SQL Server

call d:\dbmaint\maint sa %1 %2 master
call d:\dbmaint\maint sa %1 %2 pubs
call d:\dbmaint\maint sa %1 %2 testdb
echo: 
echo Maintenance complete
goto :end

:badcall
  echo:
  echo   usage:   dbmaint [Password] [Server]  
  echo: 
  echo            where 
  echo                [Password] is the sa password
  echo                [Server] is the SQL Server to be maintained
  echo:               

:end