I have two maintenance plans and also I have two user-defined databases demo1 and demo2. The first maintenance plan is used to take the backup of all the databases. the second maintenance plan is used to take the backup of demo1 and demo2. So, I am looking for a script that will show all the databases whose backup is taken in a particular maintenance plan. Suppose, I have used maintenance plan 2 in the script it should show name "maintenance plan 2" and DatabaseName="demo1,demo2"