This error message appear when I tried to restore an SQL 2K SP4 db into SQL 2005, using SQL Server Management Studio.
Although I have specified overwrite existing database, the error message still appear.
So I run transact-sql statement instead :
restore filelistonly
from disk = 'D:\SQL Backup\sourceDB.bak'
GO
--This will show the logical file name needed in the operation below
restore database targetDB
from disk = 'D:\SQL Backup\sourceDB.bak'
WITH MOVE 'sourceDB_Data' TO 'D:\SQLDATA\targetDB_Data.MDF',
MOVE 'sourceDB_Log' TO 'D:\SQLDATA\targetDB_Log.ldf',
REPLACE,STATS
GO
-- The option with replace is mandatory as it will overwrite existing database. With stat will show the operation progress
First blog post
8 years ago
Many Thanks!! I am used to SQLServer 2000 and using SQLServer Express to work from home on company data. I managed to import the dB file but had to delete the existing database as it kept saying that the Database I was trying to restore TO was in use. I deselected it, also shut Windows Explorer but no good. I eventually deleted the DB using the Manager and the database imported without a problem.
ReplyDeleteI must say that the quality of your help was spot on. Once again thanks.
Hi,
ReplyDeleteI am glad that it helps :)
Regards,
Agus
Hi Agus,
ReplyDeleteSalam kenal dari Sydney
Halo,
ReplyDeleteSalam kenal juga.
Agus
great..
ReplyDeleteThat worked a charm.
ReplyDeleteGreat! It works perfectly!
ReplyDeletei am using the same script however i still get the same error message.
ReplyDeleteI appreciate your help