• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1691
  • Last Modified:

SQL EXPRESS and SQL Server backup and restore issue smo

Hello Tech Gurus,

I took a backup of my database in SQL EXPRESS( using the backup option when when right click on the database)  and now i trying to restore this database in proper SQL SERVER( restore option we get when you right click on the database folder) and it won't. It says " Restore failed for "SERVER_NAME" Microsoft.Sql.Server.smo"
Restore failed for Server 'PURPLESERV'.  (Microsoft.SqlServer.Smo)

Following is the detailed error message

System.Data.SqlClient.SqlError: The backup set holds a backup of a database other than the existing 'StandardTimeSQL' database. (Microsoft.SqlServer.Smo)

------------------------------
Program Location:

   at Microsoft.SqlServer.Management.Smo.Restore.SqlRestore(Server srv)
   at Microsoft.SqlServer.Management.SqlManagerUI.SqlRestoreDatabaseOptions.RunRestore()

===================================

System.Data.SqlClient.SqlError: The backup set holds a backup of a database other than the existing 'StandardTimeSQL' database. (Microsoft.SqlServer.Smo)

------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&LinkId=20476

------------------------------
Program Location:

   at Microsoft.SqlServer.Management.Smo.ExecutionManager.ExecuteNonQueryWithMessage(StringCollection queries, ServerMessageEventHandler dbccMessageHandler, Boolean errorsAsMessages)
   at Microsoft.SqlServer.Management.Smo.BackupRestoreBase.ExecuteSql(Server server, StringCollection queries)
   at Microsoft.SqlServer.Management.Smo.Restore.SqlRestore(Server srv)


Thanking you in Advance
Regards

0
Danbrasco
Asked:
Danbrasco
  • 3
  • 2
3 Solutions
 
imitchieCommented:
include the WITH REPLACE command
0
 
imitchieCommented:
or from the gui, go to the 2nd tab and tick overwrite
0
 
DanbrascoAuthor Commented:
I think i have select this radio button option and manage to restore but it seems to be empty. How can i check if it has been restored.
0
 
DanbrascoAuthor Commented:
After restoring the database into SQL server, I tried creating the  same users again( that use to be in the SQL EXPRESS ) but it says that user already exsit but i don't have users listed in the login list.
Please see the following error

Server Name: SEVER_NAME
Error Number: 15023
Severity: 16
State: 1
Line Number: 1

User, group, or role 'MY_NAME' already exists in the current database. (.Net SqlClient Data Provider)
0
 
imitchieCommented:
try

sp_dropuser username

before adding again
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now