ERROR 3154 – Restore Database Error

So as I am getting more comfortable with t-sql, I am trying to use the GUI less and less. Recently I had to restore a db to a DEV server. Good chance to use t-sql instead of the GUI!

RESTORE DATABASE adventureworks
FROM DISK = 'e:\adventureworks_backup_201107062202.bak'

No can-do sir! Error!
Error 3154: The backup set holds a backup of a database other than the existing database
hmmmm…OK, with a little research here is the resolution, a simple one at that!
Simply add the WITH REPLACE at the end of the RESTORE command! Its that easy!

RESTORE DATABASE adventureworks
FROM DISK = 'e:\adventureworks_backup_201107062202.bak
WITH REPLACE

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s