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
Tuesday, May 6, 2008
Subscribe to:
Post Comments (Atom)
6 comments:
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.
I must say that the quality of your help was spot on. Once again thanks.
Hi,
I am glad that it helps :)
Regards,
Agus
Hi Agus,
Salam kenal dari Sydney
Halo,
Salam kenal juga.
Agus
great..
That worked a charm.
Post a Comment