sql-server-maintenance-solution icon indicating copy to clipboard operation
sql-server-maintenance-solution copied to clipboard

Allow ability to set a backupset name

Open jhutchings87 opened this issue 3 years ago • 1 comments

It would be nice to be able to set the backupset name to something specific or even a default of "Ola Hallengren Backup" within the DatabaseBackup procedure. This would allow tracking of Ola Backups vs VSS vs Veeam, etc. The option I am referring to is highlighted in bold below.

BACKUP DATABASE [Test] TO DISK = N'D:\SQL\Backup\TestBackup.bak' WITH COPY_ONLY, NOFORMAT, NOINIT, NAME = N'Custom Backup Job', SKIP, NOREWIND, NOUNLOAD, STATS = 10 GO

jhutchings87 avatar Oct 13 '22 12:10 jhutchings87

A VSS backup would be covered under the flag of is_snapshot. in msdb.dbo.backupset. Veeam takes VSS backups I believe, so you can easily filter between native and those.

https://learn.microsoft.com/en-us/sql/relational-databases/system-tables/backupset-transact-sql?view=sql-server-ver16

Software Vendor Id in the same table is less reliable... you're probably only see Microsoft's, as the other vendors often use Microsoft API calls.

If you want every backup to know its been done via calling Ola's backup maybe use the @Description parameter, i.e.:

EXEC [dbo].[DatabaseBackup] @Databases='USER_DATABASES', @Directory='S:\ThisBackupFolder',@Description='Ola Backup',@BackupType='FULL'

Note: I am not knocking your request, and I do not represent Ola or know him on a personal level.

Kevin-S-Lewis avatar Mar 09 '23 15:03 Kevin-S-Lewis