You are here: Re: Restore a database to another server « MsSQL Server « IT news, forums, messages
Re: Restore a database to another server

Posted by Erland Sommarskog on 11/15/07 21:57

Seguros Catatumbo (seguroscatatumbo@gmail.com) writes:
> Hi, i am using sql server 2000, and i make daily backups. I want to
> restore my backup to a test msde database i have. I don't know how i
> did it last time.
>
> -The database name is the same: "web" on both places
> -The database is located on different hard drives and the file name
> are different on both places.
>
> I tried to do it from enterprise manager, restore database, from
> device, i chose the transaction file and the database backup itself
> and tried to restore, but i got an error that i don't have exclusive
> access to the database.

RESTORE DATABASE db FROM DISK ='filenamehere'
WITH MOVE 'logicalname1' TO 'path.mdf',
MOVE 'logicalname2' TO 'path_log.ldf',
REPLACE

logicalname1/2 are the logical names of the device file. You find these
with help of sp_helpdb on the source database, or RESTORE FILELISTONLY
on the backup file.


--
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

 

Navigation:

[Reply to this 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

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