SQL Server Q&A

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries for May, 2010

FIX: Error message when you run the SQLDiag utility or the PSSDiag utility: “Exception creating Perfmon log”

Symptoms
When you run the SQLDiag utility or the PSSDiag utility to collect Performance Monitor (PerfMon) counters, you may receive the following error message:

Exception creating Perfmon logWhen this problem occurs, an error message that resembles the following message is logged in the ##Sqldiag.log file or in the ##Pssdiag.log file:

2006/07/14 01:36:02.71 PSSDIAG Exception 0xC0000005 caught.
2006/07/14 01:36:02.71 PSSDIAG Creating mini-dump file…
2006/07/14 01:36:02.87 PSSDIAG Mini-dump created
2006/07/14 01:36:02.89 ServerName\* Exception creating Perfmon log.Please see Microsoft Knowledge Base article 906532 for a possible remedyNoteThe previous error message is the version for the PSSDiag utility. In the version for the SQLDiag utility, SQLDIAG appears instead of PSSDIAG.The ##Sqldiag.log file is located in the Sqldiag folder. The Sqldiag folder is located in the same folder as the SQLDiag utility. The SQLDiag utility is located in the following folder:
%ProgramFiles%\Microsoft SQL Server\90\Tools\BinnThe ##Pssdiag.log file is located in the Output folder. The Output folder is located in the same folder as the PSSDiag utility. To obtain the PSSDiag utility, visit the following Microsoft download site:
http://www.microsoft.com/downloads/details.aspx?familyid=5564386a-28c2-4483-8293-76fff67b9eb3(http://www.microsoft.com/downloads/details.aspx?familyid=5564386a-28c2-4483-8293-76fff67b9eb3)In another scenario, the SQLDiag utility or the PSSDiag utility may unexpectedly stop after an error message that resembles the following message is logged:

2006/06/10 05:05:02.20 ServerName\* Starting Perfmon
Resolution
These problems occur because of a problem in the Microsoft Windows Performance Data Helper (PDH) library and in the performance extension DLL. Both the SQLDiag utility and the PSSDiag utility use the PDH library to collect Performance Monitor counters. The Performance Monitor counters are provided by the performance extension DLL. This DLL is available through the PDH library.

FIX: Error message when you run certain queries or certain stored procedures in SQL Server 2005: “A severe error occurred on the current command”

Symptoms
This article describes the following about this hotfix release:The issues that are fixed by the hotfix packageThe prerequisites for installing the hotfix packageWhether you must restart the computer after you install the hotfix packageWhether the hotfix package is replaced by any other hotfix packageWhether you must make any registry changesThe files that are contained in the hotfix package
Resolution
When you run certain queries or certain stored procedures in Microsoft SQL Server 2005, you receive an error message that is similar to the following:

Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded.Additionally, information that is similar to the following may appear in the SQL Server 2005 Exception.log file:

<date> <time> spid 56 Exception 0xc0000005 EXCEPTION_ACCESS_VIOLATION reading address 00000020 at 0×0110B72B 2. You may experience this problem after you upgrade a computer that is running SQL Server to the release version of SQL Server 2005.

FIX: Error message when you run a stored procedure that references a linked server that is linked to the local server itself in SQL Server 2005: “Transaction context in use by another session”

Symptoms
In SQL Server 2005, you create a linked server that is linked to the local server itself. This configuration is also known as a loopback linked server. Then, you create a stored procedure that contains a statement that resembles the following statement:

INSERT <LocalTable> EXEC <LinkedServer>.<ProcedureName>When you run the stored procedure, you receive the following error message:

Msg 3910, Level 16, State 2, Line 1
Transaction context in use by another session.Note This problem does not occur in Microsoft SQL Server 2000.
Resolution
This problem occurs because of a design change in SQL Server 2005.

FIX: Error message when you run a query that selects many columns and that joins many tables in SQL Server 2005 Service Pack 2: “The query processor could not produce a query plan”

Symptoms
In Microsoft SQL Server 2005 Service Pack 2, you run a query that selects many columns and that joins many tables. When you do this, you may receive the following error messages:
Error message 1

8624 error is being generated and a mini-dump written by the exception handler.
Error message 2

Msg 8624, Level 16, State 1, Line 1
Internal Query Processor Error: The query processor could not produce a query plan. For more information, contact Customer Support Services.Additionally, a minidump file is generated in the SQL Server log.
Resolution
This issue occurs because the query runs under the execution context of the sp_cursoropen stored procedure. The SQL Server 2005 Database Engine generates an exception when SQL Server 2005 tries to create an execution plan.

FIX: Error message when you run a “LINQ to Entities” query that uses a string parameter or a binary parameter against a SQL Server Compact 3.5 database: “The ntext and image data types cannot be …

Symptoms
This article describes the following about this hotfix release:The issues that are fixed by the hotfix packageThe prerequisites for installing the hotfix packageWhether you must restart the computer after you install the hotfix packageWhether the hotfix package is replaced by any other hotfix packageWhether you must make any registry changesThe files that are contained in the hotfix package
Resolution
Consider the following scenario. An application uses the Microsoft ADO.NET Entity Framework that is included in the Microsoft .NET Framework 3.5 Service Pack 1 to access a Microsoft SQL Server Compact 3.5 database. In the application, you run a “LINQ to Entities” query that uses a string parameter or a binary parameter against the database. In this scenario, you receive the following error message when you run the application:

The ntext and image data types cannot be used in WHERE, HAVING, GROUP BY, ON, or IN clauses, except when these data types are used with the LIKE or IS NULL predicates.

FIX: Error message when you restore a transaction-log backup that is generated in SQL Server 2000 SP4 to an instance of SQL Server 2005: “Msg 3456, Level 16, State 1, Line 1. Could not redo log r …

Symptoms
This article describes the following about this hotfix release:The issues that are fixed by this hotfix packageThe prerequisites for installing the hotfix packageWhether you must restart the computer after you install the hotfix packageWhether the hotfix package is replaced by any other hotfix packageWhether you must make any registry changesThe files that are contained in the hotfix package
Resolution
When you restore a transaction-log backup that is generated from an instance of Microsoft SQL Server 2000 with Service Pack 4 (SP4) to an instance of Microsoft SQL Server 2005, you receive anerror message intermittently. The error message resembles the following:

Msg 3456, Level 16, State 1, Line 1
Could not redo log record (11841:73811:36), for transaction ID (0:13210866), on page (3:7), database ‘&lt;DatabaseName>’ (database ID 6). Page: LSN = (11827:5010:2), type = 17. Log: OpCode = 17, context 25, PrevPageLSN: (11841:73692:1017).
Restore from a backup of the database, or repair the database.