SQL Server >> database already exists, backup or restore operation terminateing abnornally

by eddiekwang » Sat, 11 Sep 2004 01:12:57 GMT

Hello,
I am having trouble restoring a MS SQL 7 db. The databse name is
"emloyeedb". The problem started when I tried to cancel the the
restoring process. After I clicked the cancel button, it seemed the
restore process was canceled properly. The I noticed that I could no
longer see the database from the Enterprise Manager.

So I tried to re-create a database with the same name. But I got an
error message said "cannot create file
c:\MSSQL7\data\employeedb_Data.MDF" because it already exists. I went
to that directory and moved the .MDF and .log file into a different
location. Then I was able to re-create a new database called
"employeedb" from Enterprise Manager.

After that, I tried to restored the database from a .bak file. I got
an error message said "database already exists, backup or restore
operation terminateing abnornally".

Can some one tell me why I am getting this error? how to clean up my
db so that I can restore from my .bak file?

Sorry about the lengthy description. Thank you in advance for your
time.

Eddie


SQL Server >> database already exists, backup or restore operation terminateing abnornally

by Richard Ding » Sat, 11 Sep 2004 01:44:04 GMT


Try restore db with replace.









Similar Threads

1. Manually create database with existing mdf file gives Cannot create file because it already exists

Hello,

Can someone point me to a FAQ or otherwise help me install this database.  I 
have an MDF file from a VS 2005 Pro Project that I would like to play with. 
I am using SQL 2005 that came with VS 2005.  I am trying to use SQL Server 
Management Studio to create the database but when I do I get an error 1802 
(Cannot create file because it already exists).

How do I create a database with an existing MDF?

Cheers!
Jeff 


2. Re-installed SQL 7 and trying to use already existing db's without doing a restore

3. REcovery model for a backup/restore operation

Hello,

I want to do a backup and restore operations of my base, using SQLCMD.exe.

For that, I use backup database mybase to disk='File'

Then, I try to do a backup of transact log but like this:

backup log mybase to disk='File'

But I have this message : Cannot do a backup log on database which is a 
simple recovery model.

I read the BOL and I saw there are to type of recovery model: Simple and 
full. But I didn't understand  very well explications in BOL.

My questions are:

What are this models???

When are they used ???

Thanks


4. How to check if database already exists - SQL Server

5. Error 15023 : User or role "abc" already exists in current database

I have restored a database which has tables belonging to a 
particular user account created.  However, after 
restoration, I am not able to see the user account in the 
User/Logins item and not able to create a new account with 
the same name and making it the db_owner at the same time.

The system gives me this error.

Using sp_helpusers for this database, I realised that 
there is a user account with the name "abc" but there  is 
no value in the "loginName" & "DefDBName" fields.

Please advise how I can sync this.

Thanks.

6. Error 15023: User already exists in current database - SQL Server

7. User already exists in the database error

I have backed up the SQL database on server X.

I have restored that database to server Y. This server was named the same as 
server X and has the same IP. After restoring the database everything looks 
fine, until I get ready to create users in the "Logins" section of Enterprise 
Manager.

Apparently the imported database already has the same user name associated 
to it that I am trying to create and tells me that the user already exists. I 
am unable to create the "Logins"

Do you think I will get away if I create the "Logins" first and then restore 
the database afterwards?

Thanks

8. Create database when mdf already exists - SQL Server