Restoredb.bat
Using osql and trusted connection for SQL Server 2000.
@echo off
if {%2}=={} (
call :Usage
goto :EOF
)
net stop mssqlserver
net start mssqlserver
osql -E -d master -Q "restore database
%1 from disk='%2' with replace"
goto :EOF
::Subroutine area
:Usage
@echo Syntax: call restoredb.bat DatabaseName
FullDatabaseBackupPath
goto :EOF

0 Comments:
Post a Comment
<< Home