Its very easy to take Backup and Restore your Database using T-SQL even if you are not a DBA. In one of the client application, I wanted to take periodic Backup without logging in to SQL Server Management Studio. Here in this small tutorial I will try to elaborate the procedure of taking database backup using T-SQL.
1. Create a Database
CREATEDATABASE PracticeDB
2. Take Backup of the Database
BACKUPDATABASE PracticeDB TODISK='C:\PracticeD.bak'WITH DESCRIPTION='Database Backup', INIT, PASSWORD='TryAgain'