Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Query to return list of databases selected in a SQL 2005 maintenance plan?

Posted on 2008-06-12
5
Medium Priority
?
573 Views
Last Modified: 2008-09-14
Is there a SQL 2005 equivalent of the attached code to return the list of DBs in a maintenance plan?

I have heard this info may be embedded in the SSIS package and is not queryable.

Can anyone confirm?

We use LiteSpeed for our backups and have a stored proc on our SQL 2000 servers which queries a given maintenance plan name to return the list of databases that should be backed up.
This means when we change the list of databases in a maintenance plan, our proc automatically picks up the change and LiteSpeed backs up the correct databases.
Works fine, until we try it on SQL 2005 :(

Cheers, Arron
select database_name from msdb..sysdbmaintplan_databases where plan_id = @planid

Open in new window

0
Comment
Question by:arronchester
  • 2
3 Comments
 
LVL 60

Accepted Solution

by:
chapmandew earned 2000 total points
ID: 21770459
Here is what MS says about that system table:

This table is included in Microsoft SQL Server 2005 to preserve existing information for instances upgraded from a previous version of Microsoft SQL Server. SQL Server 2005 does not change the contents of this table. This table is stored in the msdb database.

This feature will be removed in the next version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

I am pretty sure that since maintenance plans in 2005 are SSIS packages (and ssis packages are XML), it is not stored in the system tables anymore....

0
 

Author Comment

by:arronchester
ID: 21770565
Thanks for your comment chapmandew.

So is there a way to open the SSIS package in TSQL and get the list of databases selected in the plan?

I've written TSQL before to open DTS packages and get details of connections using the following procs:

sp_OACreate 'DTS.Package'...
sp_OAMethod @object, 'LoadFromSQLServer'...
sp_OAGetProperty...

Can anything like this be done to get info from an SSIS package?

Thanks
0
 

Author Comment

by:arronchester
ID: 22136491
Can anybody help? :D
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a large data set and a SSIS package. How can I load this file in multi threading?
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question