Does anyone have a good method for quickly restored multiple SQL
Server 2000 databases'
I'm hoping to execute a Transact SQL script that will restore a bunch
of databases all in one step.
Any ideas/comments?
ThankyouAndrew wrote:
> Does anyone have a good method for quickly restored multiple SQL
> Server 2000 databases'
RESTORE DATABASE [myDB]
FROM DISK = 'd:\Databases\backup\myDb.BAK'
WITH
MOVE 'myDB_Data' TO 'F:\Databases\myDB_Data.mdf',
MOVE 'myDB_Log' TO 'F:\Databases\myDB_Log.ldf',
RECOVERY
rinse, repeat
As you can see this is very scriptable.
Aaron Weiker
http://aaronweiker.com/
http://www.sqlprogrammer.org/|||In Addition to Aaron's response
You can detach a 'source' database. Copy mdf and ldf files and rename them.
Attach these databases with different names.
For more details please refer to BOL
sp_detach_db
sp_attach_db
Note: After remaining the mdf and ldf files you have to issue sp_detach_db
'new name database' in order to attach it successfuly.
"Aaron Weiker" <aaron@.sqlprogrammer.org> wrote in message
news:u5zATcmDFHA.1836@.tk2msftngp13.phx.gbl...
> Andrew wrote:
>
> RESTORE DATABASE [myDB]
> FROM DISK = 'd:\Databases\backup\myDb.BAK'
> WITH
> MOVE 'myDB_Data' TO 'F:\Databases\myDB_Data.mdf',
> MOVE 'myDB_Log' TO 'F:\Databases\myDB_Log.ldf',
> RECOVERY
>
> rinse, repeat
> As you can see this is very scriptable.
> --
> Aaron Weiker
> http://aaronweiker.com/
> http://www.sqlprogrammer.org/
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment