Reply to Re: Restore SQL DB with correct logical file names

Your name:

Reply:


Posted by Erland Sommarskog on 02/27/07 22:44

blueboy (matt_meech@hotmail.com) writes:
> This is so frustrating, i have tried numerous variations and always
> get the same error can any one help??
>
> RESTORE DATABASE [new DB name]
> FROM DISK =
> 'E:\Nightly backups Man1s\[Old DB name].bak'
> WITH MOVE '[Old DB name] _Data' TO 'G:\SQLDATA\MSSQL\data\[new DB
> name] _Data.MDF',
> MOVE '[Old DB name]_Log' TO 'G:\SQLDATA\MSSQL\data\[new DB
> name]_Log.LDF',
> STATS = 1, REPLACE
> GO
>
> i get above error as stated, any help much appreciated does anyone
> actaully have this working?? if so can i see your script??

You have the syntax right, but how could I write a script for you
when I don't know the logical names of your database files? All I can
say is that

'[Old DB name] _Data'

looks funny. There are brackets in the name, and there is a blank in
the middle.

This will remain frustrating, if you just take chances on the name.
You need to find out what the names are, and there are two ways to
do it:

1) sp_helpdb on the source database. It's the first column in the
second result set, just copy and paste into the single quotes.
2) RESTIRE FILELISTONLY on the back-up file. Again, it's the first
column.


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

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