Monday 6 January 2014

Admin Script: Backup SQL Server Databases with Week Of Month Timestamp

This is my collection of generic database backup script for SQL Server using SQLCMD.exe.

The purpose of the script is to backup SQL Server database in the Week Of Month format. The script is invoked via task scheduler to perform database backup (System and User database) weekly

This script consists of two files:
1. SqlServerBackup_WeekOfMonth.cmd
    Script to setup configuration and the script invocation from Task Scheduler

2. SqlServerBackup_WeekOfMonth.sql
    T-SQL Script to perform the database backup


This script works for SQL Server Database (Express or Full Version) from version 2008 and above.

If the setup is done properly, the final result is as follows: