SQL Backup specific Name or format

jdr0606 used Ask the Experts™
Is it possible to define the name of a backup file format in SQL2014?

i.e. if I want a backup to be named DBName_YYYY_MM_DD where of course YYYY_MM_DD would be different each day.

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior Systems Administrator
Okay, what you can do is set a command when you create a job from the backup agent to name your backup like
SELECT @name ='TestDatabase' + '_' + @year + @month + @day + @hour + @minute + @second

Open in new window

I will provide a link to an apexsql site which has pictures on how this works. Link.  Scroll down to "Create the SQL Server agent schedule". Here is a picture of where you put the command. word-image-21.png
See "1. Backup the specific database" for the code you can use for a single database backup.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial