I am trying to restore a brand new database from a copy of another one and am encountering an error message stating:
System.Data.SqlClient.SqlError: The file <Backup source database file location> cannot be overwritten. It is being used by database
<Backup Source Database>. (Microsoft.SqlServer.Smo)
I am running the Restore procedure with the REPLACE option and am wondering why it is stating that the source database is the database in use when I am trying to restore and overwrite a completely different database.
This issue happens when running the replace both in C# using SMO and when manually restoring with SqlServer Management Studio
Interesting note is, the original source database is created / deployed using a database project within VisualStudios 2010 and then deployed to SqlServer through VisualStudios.
Any thoughts on why this is happening?
Thanks in advance for any help!
View Complete Post