Query to Restore a database from backup in MSSQL
Hello friends,
I had an issue in restoring a database from backup in MSSQL. Finally after a long struggle i fixed the issue by executing the following query.
I had an issue in restoring a database from backup in MSSQL. Finally after a long struggle i fixed the issue by executing the following query.
———-
Use Master
Alter Database databasename
SET SINGLE_USER With ROLLBACK IMMEDIATE
RESTORE DATABASE databasename
FROM DISK = ‘backup location’
WITH REPLACE;
Alter database databasename
SET MULTI_USER;
———–Â
If you have any similar issue, try this.
Thank you.
Regards,
Nivas.B.