Wednesday, August 15, 2012

MSSQL 2008: Database Backup

A couple of days ago it became necessary to set up automatic backups of the database using nothing, but mssql server and t-sql. The backup scenario was simple: make full backup every twenty-four hours at 00:05 and differential backup - every hour. With the following backup file name format: "DatabaseName_yyyy_dd_mm_hh_mm_[full|diff].bak" Daily backups should be stored in a separate folder, with specific name ('yyyy_mm_dd'). So this is how it could be done.