Backup And Restore Database SQL Script for SQL Server
Its a very common task to backup and restore SQL Server databases. SQL Server Management studio offers a GUI for performing backup and restore but following queries would be very useful for backup and restore if you are not having access to SQL Server Management Studio
Backup Script
BACKUP DATABASE database_name TO DISK = ‘C:\example.bak’ WITH FORMAT;
Restore Script
RESTORE DATABASE ‘DATABASE_NAME’ FROM DISK =’C:\EXAMPLE.BAK’