SQL Server Performance, DBA Best Practices & Enterprise Data Solutions | MyTechMantra

How to Restore Database in SQL Server?

Step 7. To Generate TSQL Script for the database restore click Scripts and choose Script Action to your choice from the different options which are available as shown in the snippet below.

Generate Database Restore Script Using SSMS

Step 8. Once the database is successfully restored you will get a popup message similar to the one shown in below snippet.

Restore Database Using SSMS


How to Restore a Full Database Backup in SQL Server Using TSQL Scripts

The below script can be used to restore AdventureWorks database. Change the Database File Path as per your existing setup and specify the correct Backup File location.

RESTORE DATABASE [AdventureWorks] 
FROM  DISK = N'C:\DBBackups\AdventureWorks.BAK' 
WITH  FILE = 1,  
MOVE N'AdventureWorks_Data' TO N'D:\MSSQL\MSSQL10_50.SQL2008R2\MSSQL\DATA\AdventureWorks.mdf',  
MOVE N'AdventureWorks_Log' TO N'D:\MSSQL\MSSQL10_50.SQL2008R2\MSSQL\DATA\AdventureWorks.ldf',  
NOUNLOAD,  REPLACE,  STATS = 10
GO
TSQL Script to Restore Database in SQL Server


Conclusion

In this article you have seen the steps to restore a database from its full backup.

Ashish Kumar Mehta

Ashish Kumar Mehta is a distinguished Database Architect, Manager, and Technical Author with over two decades of hands-on IT experience. A recognized expert in the SQL Server ecosystem, Ashish’s expertise spans the entire evolution of the platform—from SQL Server 2000 to the cutting-edge SQL Server 2025.

Throughout his career, Ashish has authored 500+ technical articles across leading technology portals, establishing himself as a global voice in Database Administration (DBA), performance tuning, and cloud-native database modernization. His deep technical mastery extends beyond on-premises environments into the cloud, with a specialized focus on Google Cloud (GCP), AWS, and PostgreSQL.

As a consultant and project lead, he has architected and delivered high-stakes database infrastructure, data warehousing, and global migration projects for industry giants, including Microsoft, Hewlett-Packard (HP), Cognizant, and Centrica PLC (UK) / British Gas.

Ashish holds a degree in Computer Science Engineering and maintains an elite tier of industry certifications, including MCITP (Database Administrator), MCDBA (SQL Server 2000), and MCTS. His unique "Mantra" approach to technical training and documentation continues to help thousands of DBAs worldwide navigate the complexities of modern database management.

Follow us

Don't be shy, get in touch. We love meeting interesting people and making new friends.