FIX: "Non-yielding Scheduler" error might occur when you run a query that uses the CHARINDEX function in SQL Server 2008 R2

Article translations Article translations
Article ID: 2633357 - View products that this article applies to.
Expand all | Collapse all

On This Page

SYMPTOMS

Consider the following scenario:
  • You run a query that uses the CHARINDEX function in Microsoft SQL Server 2008 R2. The CHARINDEX function uses a varchar(max) parameter as its argument.
  • The parameter uses BIN or BIN2 collation.

In this scenario, a "Non-yielding Scheduler" error might occur. Additionally, a mini-dump file is generated in the SQL Server Application log folder, and an error which resembles the following is logged in the SQL Server Error log file:
DateTime Server ***Unable to get thread context for spid 0

DateTime Server * *******************************************************************************

DateTime Server *

DateTime Server * BEGIN STACK DUMP:

DateTime Server * Date Time spid 3740

DateTime Server *

DateTime Server * Non-yielding Scheduler

DateTime Server *

DateTime Server * *******************************************************************************

DateTime Server Stack Signature for the dump is 0x0000000000000281

DateTime Server External dump process return code 0x20000001.

External dump process returned no errors.

DateTime Server Process 0:0:0 (0x10f0) Worker 0x00000000806741A0 appears to be non-yielding on Scheduler 7. Thread creation time: 12956396639383. Approx Thread CPU Used: kernel 0 ms, user 70434 ms. Process Utilization 13%. System Idle 86%. Interval: 70434 ms.

DateTime Server Process 0:0:0 (0x10f0) Worker 0x00000000806741A0 appears to be non-yielding on Scheduler 7. Thread creation time: 12956396639383. Approx Thread CPU Used: kernel 0 ms, user 130838 ms. Process Utilization 12%. System Idle 86%. Interval: 132272 ms.

DateTime spid## SQL Trace stopped. Trace ID = '2'. Login Name = 'sa'.
Note This issue is already fixed in SQL Server 2008 Service Pack 3 (SP3).

CAUSE

This issue occurs because of a defect in the methods that are used for pattern matching of binary data. The data collates in BIN or BIN2 collations.

RESOLUTION

Cumulative update information

SQL Server 2008 R2 Service Pack 1

The fix for this issue was first released in Cumulative Update 5 for SQL Server 2008 R2 Service Pack 1. For more information about how to obtain this cumulative update package, click the following article number to view the article in the Microsoft Knowledge Base:
2659694 Cumulative Update package 5 for SQL Server 2008 R2 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 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:
2567616 The SQL Server 2008 R2 builds that were released after SQL Server 2008 R2 Service Pack 1 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 website:
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.

Prerequisites

To apply this hotfix, you must have SQL Server 2008 R2 Service Pack 1 (SP1) installed.

Restart requirement

You do not have to restart the computer after you apply this hotfix.

Hotfix replacement information

This hotfix does not replace a previously-released hotfix.

File information

The global 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.
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
Sqlservr.exe2009.100.2799.043,061,60022-Dec-201121:59x86
Sqlservr.exe2009.100.2799.062,133,60022-Dec-201120:55x64
Sqlservr.exe2009.100.2799.0122,108,25622-Dec-201120:19IA-64

STATUS

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

WORKAROUND

To work around this issue, use a varchar parameter as an argument of the CHARINDEX function instead of using a varchar(max) parameter.

Properties

Article ID: 2633357 - Last Review: February 22, 2012 - Revision: 2.0
APPLIES TO
  • Microsoft SQL Server 2008 R2 Datacenter
  • Microsoft SQL Server 2008 R2 Developer
  • Microsoft SQL Server 2008 R2 Enterprise
  • Microsoft SQL Server 2008 R2 Express
  • Microsoft SQL Server 2008 R2 Express with Advanced Services
  • Microsoft SQL Server 2008 R2 Standard
  • Microsoft SQL Server 2008 R2 Standard Edition for Small Business
  • Microsoft SQL Server 2008 R2 Web
  • Microsoft SQL Server 2008 R2 Workgroup
Keywords: 
kbqfe kbhotfixserver kbfix kbautohotfix kbexpertiseadvanced kbsurveynew KB2633357

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