FIX: A non-yielding scheduler error or an error 8623 occurs when you run a query that contains a large IN clause in SQL Server 2005, SQL Server 2008, or SQL Server 2008 R2

Article translations Article translations
Article ID: 982376 - View products that this article applies to.
Microsoft distributes Microsoft SQL Server 2005, Microsoft SQL Server 2008, or Microsoft SQL Server 2008 R2 fixes as one downloadable file. Because the fixes are cumulative, each new release contains all the hotfixes and all the security fixes that were included with the previous Microsoft SQL Server 2005, Microsoft SQL Server 2008, or Microsoft SQL Server 2008 R2 fix release.
Expand all | Collapse all

On This Page

SYMPTOMS

In Microsoft SQL Server 2005, Microsoft SQL Server 2008, or Microsoft SQL Server 2008 R2, you have a query that contains a large IN clause. For example, the IN clause contains thousands of values. When you run this query, a non-yielding scheduler error may occur. Additionally, a mini-dump file is generated in the SQL Server 2005, SQL Server 2008, or SQL Server 2008 R2 log folder. Sometimes you may also see the following error message in the SQL Server Error log file:
Error: 8623, Severity: 16, State: 1.
The query processor ran out of internal resources and could not produce a query plan. This is a rare event and only expected for extremely complex queries or queries that reference a very large number of tables or partitions. Please simplify the query. If you believe you have received this message in error, contact Customer Support Services for more information.

Note If Error 8623 occurs together with the non-yielding scheduler error, the execution of the query fails.

CAUSE

This problem occurs because of an issue in the SQL Server code base. During the execution of the query that contains the large IN clause, the SQL Server code base does not yield a scheduler appropriately. This behavior causes CPU starvation for other worker threads that run on the same scheduler and causes a non-yielding scheduler error.

RESOLUTION

Cumulative update information

SQL Server 2005

The fix for this issue was first released in Cumulative Update 10. For more information about how to obtain this cumulative update package for SQL Server 2005, click the following article number to view the article in the Microsoft Knowledge Base:
983329 Cumulative update package 10 for SQL Server 2005 Service Pack 3
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2005 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
960598 The SQL Server 2005 builds that were released after SQL Server 2005 Service Pack 3 was released

SQL Server 2008 Service Pack 1

The fix for this issue was first released in Cumulative Update 9 for SQL Server 2008 Service Pack 1. For more information about this cumulative update package, click the following article number to view the article in the Microsoft Knowledge Base:
2083921 cumulative update 9 for SQL Server 2008 Service Pack 1
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 fix release. Microsoft recommends that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
970365 The SQL Server 2008 builds that were released after SQL Server 2008 Service Pack 1 was released
Microsoft SQL Server 2008 hotfixes are created for specific SQL Server service packs. You must apply a SQL Server 2008 Service Pack 1 hotfix to an installation of SQL Server 2008 Service Pack 1. By default, any hotfix that is provided in a SQL Server service pack is included in the next SQL Server service pack.

SQL Server 2008 Service Pack 2

The fix for this issue was first released in Cumulative Update 1 for SQL Server 2008 Service Pack 2. For more information about this cumulative update package, click the following article number to view the article in the Microsoft Knowledge Base:
2289254 Cumulative update 1 for SQL Server 2008 Service Pack 2
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
2402659 The SQL Server 2008 builds that were released after SQL Server 2008 Service Pack 2 was released

SQL Server 2008 R2

The fix for this issue was first released in Cumulative Update 3. For more information about how to obtain this cumulative update package for SQL Server 2008 R2, click the following article number to view the article in the Microsoft Knowledge Base:
2261464 Cumulative update package 3 for SQL Server 2008 R2
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 R2 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
981356 The SQL Server 2008 R2 builds that were released after SQL Server 2008 R2 was released

Hotfix information

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem.

If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, submit a request to Microsoft Customer Service and Support to obtain the hotfix.

Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft Web site:
http://support.microsoft.com/contactus/?ws=support
Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.

Note After you install this hotfix, if the IN clause is large enough, error 8623 will still occur because of resource exhaustion. If error 8623 still occurs after you install this hotfix, use one of the following methods:

Method 1

Decrease the number of the values in the IN clause.

Method 2

Input the values in the IN clause into a temporary table or a table variable, and then query the result set that joins the original table and the temporary table (or table variable).

Prerequisites

You must have SQL Server 2005 Service Pack 3 (SP3), SQL Server 2008, or SQL Server 2008 R2 installed to apply this hotfix.

Restart requirement

You must restart the computer after you apply this hotfix if one of the SQL Server services is running when you apply this hotfix. If you do not want to restart the computer, stop all the SQL Server services before you apply this hotfix.

Hotfix replacement information

This hotfix does not replace any other hotfixes.

File information

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.
x86-based versions of SQL Server 2005
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimeHashes
Batchparser90.dll2005.90.4035.0125,28024-Nov-200816:14
Dbghelp.dll6.6.7.51,037,15224-Nov-200814:51MD5: 288A3127F85C9416E9A3FD07EDAEDCBD
SHA1: FC10D9E27E5C6987B5CB2C5166FBF83252AC41FC
Dumpdatastore.dll2005.90.4035.01,157,47224-Nov-200814:56MD5: 9B010B4FF41DA4AFAFB94C8456D64059
SHA1: 58783B12982DFACF3D9AF4A1CAFE58A95771CE3D
Msvcp80.dll8.0.50727.42548,86413-Oct-200516:26MD5: 2BC650257FB0867ABD54FD460EC2BAFC
SHA1: EC063526AA14BCADEEFFA6D859B39A80680015B7
Msvcr80.dll8.0.50727.42626,68813-Oct-200516:26MD5: 16D7DDF3B659F7CF1CB9F4DCFF4219F0
SHA1: A61454131940799F01C26943F1594EE6E7409D11
Sqlcmd.exe2005.90.4035.0141,66424-Nov-200815:31MD5: 2E1B8DF1802612BDA20378B612D46155
SHA1: B45271F4CA358805D3515ADB9DA8D302FA40D8D0
Sqlcmd.rll2005.90.4035.024,92824-Nov-200815:14Not Applicable
Sqldiscoveryapi.dll2005.90.4035.0530,78424-Nov-200815:31MD5: 8AC29B7DF7AA97CF12E15BF4D026A96D
SHA1: 7DF7C8A0AFFC7EEE19CCA8C321494395DA06CD5C
Sqlsetupvista.dll2005.90.4035.0227,68024-Nov-200815:31MD5: FF9AF51AD873841628C0F5554BD7EB8E
SHA1: B538EFC458163E6D04056B1F191B13EF891BA50E
Finalsql2005information.rtfNot Applicable84414-Jan-201014:37Not Applicable
Sqlhotfix.chmNot Applicable116,10614-Jan-201014:37Not Applicable
Sqlse.rll1.4.1581.060,26407-Apr-201016:40Not Applicable
Sqlrun_as.mspNot Applicable27,555,32808-Apr-201001:26Not Applicable
Sqlrun_dts.mspNot Applicable14,836,73608-Apr-201001:28Not Applicable
Sqlrun_ns.mspNot Applicable3,965,95208-Apr-201001:28Not Applicable
Sqlrun_rs.mspNot Applicable16,354,30408-Apr-201001:31Not Applicable
Sqlrun_sql.mspNot Applicable39,590,40008-Apr-201001:36Not Applicable
Sqlrun_tools.mspNot Applicable48,827,90408-Apr-201001:46Not Applicable
x64-based versions of SQL Server 2005
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimeHashes
Batchparser90.dll2005.90.4035.0179,55225-Nov-200804:38
Dbghelp.dll6.6.7.51,326,94425-Nov-200804:38MD5: 1F5B11622850EBFEA889A8B6F1132F57
SHA1: 68B256D48B40C58FD67DADBC815F443C826BE073
Dumpdatastore.dll2005.90.4035.01,566,56025-Nov-200804:39MD5: D3D83B642E6D906918A4527B04E82CA1
SHA1: FADA34561343B9A1B2313335690B2B881E237678
Msvcp80.dll8.0.50727.421,097,72814-Oct-200504:46MD5: 5AE0F01F02A03558DA0CBD249E4DF263
SHA1: 64735AB4635B587647A11A599E39D2233D9DE6F0
Msvcr80.dll8.0.50727.42822,78414-Oct-200504:46MD5: 465CEBD7DA2CEABA5E552FC9118A1415
SHA1: 995060CABE3DDF199B400AD0D80FF5660626793C
Sqlcmd.exe2005.90.4035.0336,73625-Nov-200804:45MD5: 105FAD078031DF182E32C53D5994C457
SHA1: D8953F00436F38880B4B587391BD0D2309E5297E
Sqlcmd.rll2005.90.4035.025,44025-Nov-200804:40Not Applicable
Sqldiscoveryapi.dll2005.90.4035.0750,43225-Nov-200804:45MD5: 0826CE00BFB5DA7374E4D0E146942471
SHA1: 668553462BD285FBDC241A23E4E259FEF1235DEF
Sqlsetupvista.dll2005.90.4035.0316,25625-Nov-200804:45MD5: 41BBA84E4D204046EF0059E573B98988
SHA1: 557F186F46D09AE59C655B52675D604593E8E611
Finalsql2005information.rtfNot Applicable84414-Jan-201014:37Not Applicable
Sqlhotfix.chmNot Applicable116,10614-Jan-201014:37Not Applicable
Sqlse.rll1.4.1581.060,77607-Apr-201017:33Not Applicable
Sqlrun_as.mspNot Applicable46,118,40008-Apr-201001:15Not Applicable
Sqlrun_dts.mspNot Applicable22,150,65608-Apr-201001:18Not Applicable
Sqlrun_ns.mspNot Applicable5,689,34408-Apr-201001:19Not Applicable
Sqlrun_rs.mspNot Applicable21,256,19208-Apr-201001:22Not Applicable
Sqlrun_sql.mspNot Applicable45,197,31208-Apr-201001:28Not Applicable
Sqlrun_tools.mspNot Applicable65,248,76808-Apr-201001:38Not Applicable
IA-64-based versions of SQL Server 2005
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimeHashes
Batchparser90.dll2005.90.4035.0293,72824-Nov-200819:52
Dbghelp.dll6.6.7.53,631,45624-Nov-200819:52MD5: BB797393886A04ED2847AC966A23439D
SHA1: B43F7926C0FD268F4496A116B9176753601B5EAD
Dumpdatastore.dll2005.90.4035.04,322,14424-Nov-200819:47MD5: 5677EC5C5DA9AB7C71580996E598433E
SHA1: A98591A4D220C293A6C8E1D2B17E3C4847545721
Msvcp80.dll8.0.50727.421,385,47214-Oct-200504:35MD5: 7F0715E63E08692F39C017A6A2D61E56
SHA1: 24B674285AC11D0496529EBC9E7FADC7B7955AC3
Msvcr80.dll8.0.50727.421,484,80014-Oct-200504:35MD5: 88B3570029DEC94B06199DB8E7EB66D9
SHA1: FC8EE955B19FCE0F4F1C8F17F9AD97ACB4E129A4
Sqlcmd.exe2005.90.4035.0530,78424-Nov-200820:03MD5: 512C6ECF02979B75B5C52D5F3021C379
SHA1: 03A8D2BE83EFF1ACE5B002D5E390670B1EF14D83
Sqlcmd.rll2005.90.4035.024,41624-Nov-200819:58Not Applicable
Sqldiscoveryapi.dll2005.90.4035.01,939,80824-Nov-200820:04MD5: 63834474BB3D9B15958A40B0FF102F93
SHA1: F00BE0A455B134CF17FF6C9FBCF19D93BC6F403B
Sqlsetupvista.dll2005.90.4035.0702,81624-Nov-200820:04MD5: 593F2B3BD7C92AEF28A751D5C4421C84
SHA1: 58D55D1822E697D701F9B45A50A6A5B67B998E77
Finalsql2005information.rtfNot Applicable84414-Jan-201014:37Not Applicable
Sqlhotfix.chmNot Applicable116,10614-Jan-201014:37Not Applicable
Sqlse.rll1.4.1581.059,24007-Apr-201020:04Not Applicable
Sqlrun_as.mspNot Applicable67,258,36808-Apr-201000:57Not Applicable
Sqlrun_dts.mspNot Applicable35,875,32808-Apr-201001:01Not Applicable
Sqlrun_ns.mspNot Applicable12,269,05608-Apr-201001:02Not Applicable
Sqlrun_rs.mspNot Applicable31,128,57608-Apr-201001:06Not Applicable
Sqlrun_sql.mspNot Applicable69,868,03208-Apr-201001:13Not Applicable
Sqlrun_tools.mspNot Applicable65,883,64808-Apr-201001:23Not Applicable

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

REFERENCES

For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684 Description of the standard terminology that is used to describe Microsoft software updates

Properties

Article ID: 982376 - Last Review: November 15, 2010 - Revision: 8.0
APPLIES TO
  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Enterprise Edition
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Workgroup Edition
  • Microsoft SQL Server 2005 Standard X64 Edition
  • Microsoft SQL Server 2005 Standard Edition for Itanium-based Systems
  • Microsoft SQL Server 2005 Enterprise X64 Edition
  • Microsoft SQL Server 2005 Enterprise Edition for Itanium-based Systems
  • Microsoft SQL Server 2008 R2 Developer
  • Microsoft SQL Server 2008 R2 Enterprise
  • Microsoft SQL Server 2008 R2 Standard
  • Microsoft SQL Server 2008 R2 Workgroup
Keywords: 
kbautohotfix kbfix kbsurveynew kbqfe KB982376

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com