Microsoft Knowledge Base Email Alertz

Error message when you use Database Engine Tuning Advisor in SQL Server 2005: Attempt to initialize the CRT more than once

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 913395 - Last Review: February 6, 2006 - Revision: 1.1

Error message when you use Database Engine Tuning Advisor in SQL Server 2005: "Attempt to initialize the CRT more than once"

Important This article contains information about how to modify the registry. Make sure to back up the registry before you modify it. Make sure that you know how to restore the registry if a problem occurs. For more information about how to back up, restore, and modify the registry, click the following article number to view the article in the Microsoft Knowledge Base:
256986  (http://kbalertz.com/Feedback.aspx?kbNumber=256986/ ) Description of the Microsoft Windows registry

SYMPTOMS

When you use Database Engine Tuning Advisor to analyze the performance effects of workloads in Microsoft SQL Server 2005, you may receive the following error message:
R6031- Attempt to initialize the CRT more than once. This indicates a bug in your application.
Additionally, Database Engine Tuning Advisor stops responding after you receive this error message.

CAUSE

This problem occurs because of the application compatibility settings. The application compatibility settings may be set separately for the application. Alternatively, the application compatibility settings may be inherited from the settings that are specific to the Explorer.exe process. When you explicitly set the application compatibility settings for the Explorer.exe process, all applications that are started from the Explorer.exe process inherit the same application compatibility settings.

If Database Engine Tuning Advisor inherits the application compatibility settings from the Explorer.exe process, the Microsoft Windows loader tries to initialize the C run-time library (CRT) Msvcp80.dll file two times when you start Database Engine Tuning Advisor. Therefore, Database Engine Tuning Advisor stops responding.

WORKAROUND

Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.

To work around this problem, you must set the Explorer.exe process to stop using the application compatibility technology. To do this, follow these steps:
  1. Click Start, click Run, type regedit, and then click OK.
  2. Locate the following registry subkey:
    HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
  3. In the right pane, right-click the registry entry for the Explorer.exe process, and then click Delete.
  4. In the Confirm Value Delete dialog box, click Yes.
  5. Exit Registry Editor.
  6. Restart the computer.

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 Windows application compatibility technology, click the following article number to view the article in the Microsoft Knowledge Base:
301911  (http://kbalertz.com/Feedback.aspx?kbNumber=301911/ ) How to use the Program Compatibility Wizard in Windows XP

APPLIES TO
  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Enterprise Edition
Keywords: 
kbtshoot kbsql2005tool kbexpertiseadvanced kbprb KB913395
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

J Hamilton Report As Irrelevant  
Written: 4/24/2006 12:17 AM
This is an issue on my XP box, and I don't have the compatibility layer enabled in my registry.