Wednesday, 7 December 2011

Fixing the Database Restore When You get error no. 3154 in MS Sql Server 2008 /2008 R2

In Ms SQL Server 2008/ 2008 R2, some times you get an Error no. 3154 that  database  cannot be restored from the .bak file. To Fix it Follow the procedure:--

1. Use the Current Db as Master. i.e. Use master;
2. Now delete your old database which in not restoring, Say [dbo].[Quizzana ]
3. Create a new Database of the Same name after deleting it.
        CREATE DATABASE Quizzana;
4. Now click on the New Query and write the following command:
   Use Master;
     RESTORE DATABASE Quizzana
  
FROM DISK = 'C:\Quizzana.bak'
  
WITH REPLACE

Note: 
1. Here Disk="c:\Quizzana.bak" is the path where the .bak file is present.
2. Use the current database as master while executing the Query otherwise it will show an error that   the database session is in use.
                                                              
 


No comments:

Post a Comment