Solved

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

Posted on 2008-06-12
5
567 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 60

Accepted Solution

by:
chapmandew earned 500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Format Date fields 11 58
Any benefit to adding a Clustered index here? 4 35
Rewriting a simple query 2 28
SQL query joining 6 tables in asp.net 4 19
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how the fundamental information of how to create a table.

738 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