Does anyone know if it is possible to modify the maintenance plans through t-sql and if so please provide the code to do so.

THANKS!

Assuming SQL Server 2005 +.

The maintenance plan is typically an ssis package stored either in the database or on the file system. Yes, you can edit these packages just like any other SSIS package.

Expand Management-> Maintenance Plans and double click the plan. The plan should open for editing. If not, you'll need to export the package and edit in BIDS.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.