Showing posts with label server2000. Show all posts
Showing posts with label server2000. Show all posts

Tuesday, March 20, 2012

automatic restoration

any automated restoration script is available in sql server2000.
I want to do the restoration for 10 databases(full backup,latest differential backup) in other server.

Pls do the needful.

Quote:

Originally Posted by bharadwaj

any automated restoration script is available in sql server2000.
I want to do the restoration for 10 databases(full backup,latest differential backup) in other server.

Pls do the needful.


Try the following

use master
go
declare @.file varchar(200)
select @.file = 'c:\dbackup.backup'

declare @.mdf varchar(500), @.ldf varchar(500)
select @.mdf = 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\databasename.mdf'
select @.ldf = 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\databasename_log.ldf'

restore database <databasename>
from disk = @.file
with
move 'databasename' to @.mdf,
move 'databasename_Log' to @.ldf
go|||Thanks for ur reply.I will try it and let you know.
Bharat

Quote:

Originally Posted by Vidhura

Try the following

use master
go
declare @.file varchar(200)
select @.file = 'c:\dbackup.backup'

declare @.mdf varchar(500), @.ldf varchar(500)
select @.mdf = 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\databasename.mdf'
select @.ldf = 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\databasename_log.ldf'

restore database <databasename>
from disk = @.file
with
move 'databasename' to @.mdf,
move 'databasename_Log' to @.ldf
go

sql