Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 DataBase Restore Error

Author  Topic 

AsimKhaliq
Yak Posting Veteran

94 Posts

Posted - 2003-11-19 : 14:02:52
Hey
I want to restore my database, but I am running my wizard to restore the database it gives an error that database in use. Can anyone help me in restoring the database.

nr
SQLTeam MVY

12543 Posts

Posted - 2003-11-19 : 14:10:04
You have to kill all the users in the database before you can restore over it.
Might be easier to drop the database first.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2003-11-19 : 15:28:45
[code]
ALTER DATABASE <dbName> SET SINGLE_USER WITH ROLLBACK IMMEDIATE

RESTORE DATABASE <dbName>
FROM DISK = 'D:\*.dmp'
WITH MOVE '<dbanme>_Data' TO 'D:\Database\Server\Instance\Data\<dbName>.MDF'
, MOVE '<dbname>_Log' TO 'D:\Database\Server\Instance\Data\<dbName>.LDF'
, REPLACE

ALTER DATABASE <dbname> SET READ_WRITE


[/code]


Brett

8-)
Go to Top of Page
   

- Advertisement -