SQL Backup specific Name or format

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.

Thanks
jdr0606Asked:
Who is Participating?
 
ITSysTechConnect With a Mentor Senior Systems AdministratorCommented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.