Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8576371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:54:35+00:00 2026-06-11T19:54:35+00:00

I have an SSIS package that is failing with the above error. The database

  • 0

I have an SSIS package that is failing with the above error.

The database has a query governor limit of 300

I have tried adding an ‘Execute SQL’ task to my package before the data flow task to execute the statement:

SET QUERY_GOVERNOR_COST_LIMIT 0 

This shows as success during package execution, but my dataflow task is still failing and reporting the limit to be 300.

Source: “Microsoft SQL Server Native Client 10.0 ” Hresult:
0x80004005 Description: “The query has been canceled because the
estimated cost of this query (336) exceeds the configured threshold of
300. Contact the system administrator.”. End Error

How can I override this setting on my data flow task?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T19:54:36+00:00Added an answer on June 11, 2026 at 7:54 pm

    Unless you have set the “retain same connection” property on the package, which is not my preference for what it’s worth, what you are experiencing is what the documentation states.

    Using SET QUERY_GOVERNOR_COST_LIMIT applies to the current connection only 
    and lasts the duration of the current connection
    

    Inside your package, a connection is opened for the Execute SQL Task, your query governor statement is issued and that task terminates. A new/different connection is then used in your Data Flow task as part of the OLE DB Source (or ADO.NET Source). That connection has not modified the costing for the governor and therefore it is subject to the QG.

    To resolve this, you need to modify your source in the Data Flow. Assuming you just selected the table you wanted, you will need to switch the radio button from Table Source to Query Source (names approximate). As the source for this query, you would then use something like

    SET QUERY_GOVERNOR_COST_LIMIT 0;
    SELECT
        MT.*
    FROM
        dbo.MyTable AS MT;
    

    Edit

    Given that it’s the target table that is blowing the QG limit, the quick and dirty approach would be to modify your Destination’s Connection Manager to set the RetainSameConnection property to True. This will ensure the same connection in your destination transformation has had the cost already modified. There’s a screen shot of where you set that in my answer over on this question

    SSIS: Default Logging OnError don't work with RetainSameConnection

    Other approaches that might work, would be to modify the data load to reduce the query (insert) cost.

    • You might be able to get there by reducing your commit size and/or batch size.
    • If the target table is heavily indexed, the cost of maintaining all the indexes could be pushing you over the threshold for the query governor so drop and recreate non-clustered indexes before and after the package runs might reduce the insert cost. It may also just kick the can (cost) down the road as recreating the NCIes may make the job take longer
    • If you’re on enterprise edition and are using partitioning, you might be able to load to an empty partition and swap that in. I assume that is not the case in this situation and as partitioning can make a problem worse if not done well.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SSIS package that has a child package that is failing. The
I have an SSIS package that takes data from Tables in an SQL database
I have an SSIS 2008 package that reads data from an Access database (OLEDB
I have an ssis package that imports a view from one database into different
I have an SSIS package that queries data from a view using an SQL
I have written an SSIS package that essentially takes data from multiple sources and
I have an SSIS (2005) package that transforms some XML data and then imports
I have a DTS (not SSIS) package that hasn't been touched in years that
I have an OLE DB Command component in an SSIS Package that runs an
I have simple SSIS package in which On Error event handler I have created

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.