Reply to Re: Viewing backup in a different location

Your name:

Reply:


Posted by Erland Sommarskog on 06/21/07 22:02

Steve F (scfisher@gmail.com) writes:
> i have a copy of a SQL Server 2000 database on an external hardrive.
>
> I have SQL Enterprise Manager 2005 on my laptop and was wondering if
> it is possible to view the backup on my laptop when external hard
> drive is plugged in.
>
> What other software/tools/procedures do i need to do to make the
> backup "viewable"

It is not fully clear to me if you have a backup of the database,
or a copy of the MDF and LDF files. But assuming you have a backup,
first to:

RESTORE FILELISTONLY FROM DISK ='X:\...\backup.bak'

where X is the drive-letter for your removable disk. Pay attention to
the column logical name. Then restore the database with this command:

RESTORE DATABASE db FROM DISK='X:\...\backup.bak' WITH
MOVE 'LogicalName1' TO
'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\db.mdf',
MOVE 'LogicalName2' TO
'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\db.ldf',
REPLACE

You could choose other physical locations for the database if you wish.

You could also use the GUI in Management Studio to perform the RESTORE,
but I don't use that myself.

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация