I would like to use a tsql query to retrieve the databases involved in one of the steps in a database backup plan I've created. From a previous question, I understand that somehow, the data is probably stored in the msdb
database, but running a trace didn't reveal the query that retrieved the "checked" status of each selected database.
Does anyone know how SQL Server determines which of the server's databases are included in a particular job step?
Best Answer
I don't believe there is a way. If you create a Maintenance Plan, it is going to be an SSIS package. Querying the
msdb.dbo.sysjobsteps
table, you can view the actualcommand
, but for an SSIS package execution it won't be indicative to the particulare databases you are backing up:This will give you something similar to the following command: