Plip's Weblog

Phil Winstanley - British Microsoft ASP.NET MVP & ASP Insider.

SQL Server 2005 Backups

This post is more for my memory than anything else but ... I've had issues restoring a SQL 2005 database from a backup today using the SQL Workbench with the following error message: -

The backup set holds a backup of a database other than the existing 'MyDatabase' database.
RESTORE DATABASE is terminating abnormally. (Microsoft SQL Server, Error: 3154)

I spoke to a good friend (Tony Rogerson) and he sent me a command to run: -

restore database MyDatabase from disk = 'C:\MyDatabaseBackup\MyDatabase.BAK' with replace

And it worked a treat!

Comments

Inala Shankar said:

Thats a great info....i appreciate your contribution...Thank you

# February 20, 2007 5:28 PM

PRINCE V said:

Tony Rogerson hey good work , your can be a icon for everyone who want to serve other people.

KEEP DOING THE GOOD WORK

# March 7, 2007 4:11 AM

Roni said:

restore database MyDatabase from disk = 'C:\MyDatabaseBackup\MyDatabase.BAK' with replace

thats good...i was wondering if u can help me out in writing a batch file so i can execute this command in order to compile a restore from a backupd atabase using sql server 2005 express edition...i have it installed somewere in the office and i want to know if it will restore the database.

# May 3, 2007 2:24 AM

Narendra said:

Thanks for giving good information.

# October 24, 2007 2:28 AM

Jacob Egholm said:

Great tip. The command worked like a charm:o)

# February 25, 2008 3:42 PM

ants said:

What else can u say but thanks to a man who jotted down a command on the net to save not just himself but many others like me....Thanks man

# March 4, 2008 2:34 AM

Raja said:

Wow!!!!!!!!!! Excellent man. Thanks for sharing it with us

# April 29, 2008 4:57 PM

mahantesh said:

i tried it,,,but its giving me syntax error..

# July 17, 2009 7:30 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)