December 29, 2025 at 9:50 am
I have a SQL Agent job for backing up a set of Analysis Services databases with each database covered by a different "SQL Server Analysis Services Command" job step of the form:
{
"backup": {
"database": "CUBE NAME",
"file": "CUBE NAME.abf",
"allowOverwrite": false,
"applyCompression": true
}
}However, if a database is added, deleted or renamed the job fails the particular step - which could result in a database not being backed up.
Is there a way to write this Agent job so that it can dynamically manage the database names?
Thanks.
December 29, 2025 at 11:07 am
use a powershell script instead - you can get all db names, and then do backup https://learn.microsoft.com/en-us/powershell/module/sqlserver/backup-asdatabase?view=sqlserver-ps
one other possible option is to have a job that updates the xmla of the backup job to include all databases (or to add a new step) and then starts that job
December 29, 2025 at 5:32 pm
Need to see more code to know what might work, but PoSh is often easier for programming some stuff than T-SQL, especially looping type constructs.
December 29, 2025 at 5:46 pm
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply