Let me explain the issue briefly.
I am using MSSQL server 2008r2 on which there is a existing database with name "portaluser2" i have created one more database with dbname "chandigarh".
I took the back up of database "portaluser2" and tried to restore it to database "chnadigarh" at time of restoration i am getting error, which i have listed below. Kindly keep in mind that i want both my databases online and unning. Kindly assist if anyone have any idea on this.
Error: TITLE: Microsoft SQL Server Management Studio
Restore failed for Server '64.31.20.2,7426'. (Microsoft.SqlServer.SmoExtended)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.4042.0+((KJ_SP2_GDR).150326-2110+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: The backup set holds a backup of a database other than the existing 'chandigarh' database. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.4042.0+((KJ_SP2_GDR).150326-2110+)&LinkId=20476
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Saying that you're restoring one database to the other database implies that you want to replace the target database with the source database. If so, then just delete the target database and restore the source database with the appropriate name and location to become the target database. The target database doesn't need to exist beforehand and this is where you're running into trouble.