I am using SQL 2012 and am trying to restore a database A.bak over the top of an existing database B . I have ticked Overwrite existing database (With replace) and told it to relocate all files to the new folder and changed the Restore As file details to the existing database filesbase but I get an error
System.data.SqlClient.SqlError: The file '<B.mdf>' cannot be overwritten. It is being used by database <B>. (Microsoft.SqlServer.SmoExtended)
I have done this exact procedure on previous SQL versions with no problems, just 2012. Any ideas ?