Sql Server Database Restore

Hi all

I created a backup of an exixting database in sql server i then created a new seperate database, because i wanted to restore the backup onto the new database so i could compare a few things.

When i try to restore i get an error message saying

TITLE: Microsoft SQL Server Management Studio
------------------------------

Restore failed for Server 'Sharepoint'.  (Microsoft.SqlServer.SmoExtended)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1+((KJ_RTM).100402-1539+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

System.Data.SqlClient.SqlError: The file 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\DB_Opera_Copy_Data.mdf' cannot be overwritten.  It is being used by database 'DB_Opera_Copy'. (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1+((KJ_RTM).100402-1539+)&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------
can anybody assist me with this.

Thanks
pepps11976Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

EvilPostItCommented:
System.Data.SqlClient.SqlError: The file 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\DB_Opera_Copy_Data.mdf' cannot be overwritten.  It is being used by database 'DB_Opera_Copy'.

Your trying to use a datafile with the same physical name as a database that already exists.
0
pepps11976Author Commented:
Ok i can see that now so what would be the easiest way to acheive what i am trying to do?
0
EvilPostItCommented:
If your doing this in management studio, go to the options tab and change the filename of the DB_Opera_Copy_Data.mdf file.

If you doing this using a RESTORE command use WITH MOVE to change the file location.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.