Ignoring offline databses in SQL 2005 -- SSIS package getting failed

  • In of the SQL 2005 (Service Pack 3 Cumulative Update 4) envrionment , one database is offline. Becauase of this offline database maintenance plan is continously failing.

    I observed after checking the TSQL script for the Database Integrity task in SSIS package that offline database name is appearing there . Moreover SSIS package is failing with the eror message :

    "Executing the query "USE [DBANAME]

    " failed with the following error: "Database 'DBNAME' cannot be opened because it is offline.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

    "

    I dont want to go for the option to choose the 'THESE DATABASE ' options while re creating the database integrity task , because this option wont add the new database dynamically in the package.

    Can anyone please suggest some solution for this.

  • In SQL Server 2008 a new feature has been added to ignore databases which are not online in Maintenance Plans. More details here.

    ASAIK, there is no such provision in SQL Server 2005. You may have to use custom script to ignore offline databases.

    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @pradeepadiga

  • are you using the standard maintenance plan tasks or a custom script? at first i thought you were using the standard tools but then you mentioned about dynamically adding new databases (unless you using the "all databases" tick box in the builtin tools in the maintenance plan packages).

    your best just using a custom script

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply