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 Tagged ‘error’

FIX: BCP Out Fails with Exception Error if You Use a Format File to Change Order of Columns

Symptoms
If you use Bcp.exe to export a table to a flat file, the process may fail with an exception error if you use a format file to change the order of the columns during the export. The exception error occurs within the Bcp.exe file and the following error message appears:

The instruction at “memory_address” referenced memory at “memory_address”.
The memory could not be “written”.The output file is created but no rows are exported.
Resolution
Use a view to change the order of the columns to export. Then, use the view when you perform the bulk copy program and have the format file match the order of the columns in the view.

Error message when you try to install SQL Server 2005 Express Edition or SQL Server 2005 Express Edition with Advanced Services: “Server SQL Server is terminating because of fatal exception c000001d”

Symptoms
When you try toinstall Microsoft SQL Server 2005 Express Edition (SQL Server Express) or Microsoft SQL Server 2005 Express Edition with Advanced Services, the installation fails. Additionally, you receive the following error message:

Server SQL Server is terminating because of fatal exception c000001d.If you examine the SQL Server error log when this problem occurs, you see an error message that resembles one of the following:
Error message 1

SqlDumpExceptionHandler: Process 4 generated fatal exception c000001d EXCEPTION_ILLEGAL_INSTRUCTION. SQL Server is terminating this process.
Error message 2

2006-03-02 22:40:24.79 ServerError: 17311, Severity: 16, State: 1.
2006-03-02 22:40:24.79 ServerSQL Server is terminating because of fatal exception c000001d. This error may be caused by an unhandled Win32 or C++ exception, or by an access violation encountered during exception handling.For more information about how to examine the SQL Server error log, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn2.microsoft.com/en-us/library/ms187885.aspx(http://msdn2.microsoft.com/en-us/library/ms187885.aspx)
Resolution
This problem occurs because of one of the following reasons:The computer on which you try to install SQL Server Express or SQL Server Express with Advanced Services is equipped with a CPU that does not support cache prefetching.
The affected CPUs include VIA Eden CPUs and Transmeta CPUs. Typically, these CPUs are used in devices when low power consumption,low heat, or low noise is important.The media from which you try to install SQL Server Express or SQL Server Express with Advanced Services is corrupted.

BUG: Error 3154 Reported in Log Shipping Restore Job Sporadically

Symptoms
The following error message may appear in the SQL Server Log Shipping Monitor View Restore History window:

[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 3154: [Microsoft][ODBC SQL Server Driver][SQL Server]The backup set holds a backup of a database other than the existing ‘pubs_test’ database.
[Microsoft][ODBC SQL Server Driver][SQL Server]RESTORE LOG is terminating abnormallyThe preceding error message occurs if: You configure multiple databases for log shipping.You back up the transaction logs for the databases to the same folder.The database names only differ by “_tlog” in the name. For example, pubs_test and pubs_test_tlog.
Resolution
The RESTORE job that runs on the secondary server incorrectly parses the transaction log backup file names and attempts to restore transaction logs that belong to a different database. This behavior does not cause any other problems on the primary or the secondary servers.

The syspolicy_purge_history SQL Server Agent job may fail in SQL Server 2008

Symptoms
In Microsoft SQL Server 2008, the syspolicy_purge_history SQL Server Agent job may fail when you run the syspolicy_purge_history job on a clustered instance. You may receive an error message that resembles the following in the history log file for the syspolicy_purge_history job:

Date datetime
Log Job History (syspolicy_purge_history)
Step ID 3
Server SQLVirtualName\instancename
Job Name syspolicy_purge_history
Step Name Erase Phantom System Health Records.
Duration 00:00:33
Sql Severity 0
Sql Message ID 0
Operator Emailed
Operator Net sent
Operator Paged
Retries Attempted 0
Message
Executed as user: user. The job script encountered the following errors. These errors did not stop the script: A job step received an error at line 1 in a PowerShell script. The corresponding line is ‘(Get-Item SQLSERVER:\SQLPolicy\SQLVirtualName\instancename).EraseSystemHealthPhantomRecords()’.
Correct the script and reschedule the job. The error information returned by PowerShell is: ‘SQL Server PowerShell provider error: Could not connect to ‘SQLVirtualName\instancename’. [Failed to connect to server SQLVirtualName\instancename. --> An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)] Failed to connect to server SQLVirtualName\instancename. An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) ‘
A job step received an error at line 1 in a PowerShell script. The corresponding line is ‘(Get-Item SQLSERVER:\SQLPolicy\SQLVirtualName\instancename).EraseSystemHealthPhantomRecords()’. Correct the script and reschedule the job. The error information returned by PowerShell is: ‘Cannot find path ‘SQLSERVER:\SQLPolicy\SQLVirtualName\instancename’ because it does not exist. ‘ A job step received an error at line 1 in a PowerShell script. The corresponding line is ‘(Get-Item SQLSERVER:\SQLPolicy\SQLVirtualName\instancename).EraseSystemHealthPhantomRecords()’. Correct the script and reschedule the job. The error information returned by PowerShell is: ‘You cannot call a method on a null-valued expression. ‘. Process Exit Code -1. The step failed.
Resolution
This problem may occur if the syspolicy_purge_history job uses the computer node name instead of the virtual server name for the cluster instance.

SQL Server 7.0 Acmsetup.exe setup application fails

Symptoms
When the Configuring Server portion of a SQL Server 7.0 installation is in progress, this series of error messages may appear:

{acmsetup.EXE – Application Error
The application failed to initialize properly (0xc0000006).Click on OK to terminate the application.}Followed by:

sqlservr.exe – Unable To Locate DLL
The dynamic link library MSWSTR10.DLL could not be found in the specified path:
d:\MSSQL7\binn;C:\WINNT;C:\WINNT\system32Followed by:

Setup
Setup failed to configure the server.Refer to the server error logs and cnfgsvr.out for more information.If you run just the Mdac_typ.exe executable file that is located in the x86\Other folder of the SQL Server 7.0 CD, you may see:This error message:

acmsetup.EXE – Application Error
The application failed to initialize properly (0xc0000006).Click on OK to terminate the application.An entry similar to this in the Cnfgsvr.out file:

Starting Service…An error occurred while attempting to start the service (1053)SQL Server Configuration failed. An entry similar to this in the Sqlstp.log file:

08:56:46 Path successfully updated. 08:56:46 %SystemRoot%\system32;%SystemRoot%;D:\MSSQL7\BINN 08:56:46 D:\MSSQL7\binn\cnfgsvr.exe-Silent 2 -NoSampleDB 0 -SQLPath”D:\MSSQL7\” -SQLDataPath “E:\MSSQL7\” -SortID 52 -LCIDCompStyle “1033-196609″ -HWND 27001094 -User sa -Pwd 08:58:58 Process Exit Code: (-1)08:59:00 Setup failed to configure the server.Refer to the server error logs and cnfgsvr.out for more information. 08:59:00 Action CleanUpInstall: 08:59:00 C:\TEMP\_ISTMP10.DIR\scm.exe-Silent 1 -Action 4 -Service SQLServerAgent 08:59:00 Process Exit Code: (1060) The specified service does not exist as an installed service. 08:59:00 C:\TEMP\_ISTMP10.DIR\scm.exe-Silent 1 -Action 4 -Service MSSQLServer 08:59:05 Process Exit Code: (0)08:59:05 Installation Failed.
Resolution
An 0xc000006 exception error occurs when the system attempts to retrieve a swapped-out page and fails.

Issues that you may encounter when you install a named instance of one or more SQL Server 2005 components and you specify different installation locations for one or more of the components

Symptoms
Consider the following scenario:You install a named instance of one or more of the following Microsoft SQL Server 2005 components:SQL Server Database ServicesSQL Server Analysis ServicesOn the “Components to Install” page, you specify different installation locations for one or more of the components as follows:You specify that Database Services is to be installed in a folder that is named “MSSQLServer.”You specify that Analysis Services is to be installed in a folder that is named “MSSQLServerOLAPService.”Note The names of these folders are case sensitive.In this scenario, you may encounter the following symptoms.
Symptom 1Specific .ini files for the components that are mentioned earlier contain information as follows:If you install Database Services, information that resembles the following is contained in the Perf-InstanceNamesqlctr.ini file:
[info]
drivername=MSSQL$InstanceName
trusted=
symbolfile=Drive:\MSSQL$InstanceName\MSSQL.X\MSSQL\Binn\sqlctr.hIf you install Analysis Services, information that resembles the following is contained in the Perf-InstanceNamemsmdctr.ini file:
[info]
drivername=MSOLAP$InstanceName
symbolfile=Drive:\MSOLAP$InstanceName\MSSQL.X\OLAP\bin\msmdctr.h
Symptom 2During the installation of SQL Server 2005, you receive the following error message:

The setup has encountered an unexpected error while installing performance counters. The error is: The specified driver is invalid.
Symptom 3After you click Ignore when you receive the error message that is mentioned in Symptom 2, SQL Server Setup finishes its operation successfully. However, the following error message is logged in the SQLSetup0001_ComputerName_SQL.log file:

Error Code: 2001
MSI (s) (44!C4) [Time]: Product: Microsoft SQL Server 2005 — Error 29528. The setup has encountered an unexpected error while Installing performance counters. The error is: The specified driver is invalid.
Error 29528. The setup has encountered an unexpected error while Installing performance counters. The error is: The specified driver is invalid.
<Failure Type=’Ignored’>
Symptom 4If you install SQL Server 2005 Service Pack 1 (SP1) or SQL Server 2005 Service Pack 2 (SP2) afterward, you experience the following issues.SQL Server 2005 SP1When you install SQL Server 2005 SP1, you receive the following error message:

A recently applied update, KB913090, failed to install.The followingerror message is logged in the SQL9_Hotfix_KB913090.log file:

Date and Time Failed to read registry key: Debug
Date and Time MSP returned 1603: A fatal error occurred during installation.
Date and Time Successfully opened registry key: Software\Policies\Microsoft\Windows\Installer
Date and Time Failed to read registry key: Debug
Date and Time Unable to install MSP file: \\ComputerName\f$\64b4ce0abc66d8453d93b0a1fa\HotFixSQL\Files\sqlrun_sql.msp
Date and Time The following exception occurred: Unable to install Windows Installer MSP file Date and Time File: \depot\sqlvault\setupmain\setup\sqlse\sqlsedll\copyengine.cpp Line: 856The following error message is logged in the SQL9_Hotfix_KB913090_sqlrun_sql.msp.log file:

MSI (s) (C8:A0) [11:15:21:752]: Product: Microsoft SQL Server 2005 – Update ‘Service Pack 1 for SQL Server Database Services 2005 ENU (KB913090)’ could not be installed. Error code 1603. Additional information is available in the log file C:\WINDOWS\Hotfix\SQL9\Logs\SQL9_Hotfix_KB913090_sqlrun_sql.msp.log.
MSI (s) (C8:A0) [Time]: Note: 1: 1729
MSI (s) (C8:A0) [Time]: Transforming table Error.
MSI (s) (C8:A0) [Time]: Note: 1: 2262 2: Error 3: -2147287038
MSI (s) (C8:A0) [Time]: Transforming table Error.
MSI (s) (C8:A0) [Time]: Transforming table Error.
MSI (s) (C8:A0) [Time]: Note: 1: 2262 2: Error 3: -2147287038
MSI (s) (C8:A0) [Time]: Transforming table Error.
MSI (s) (C8:A0) [Time]: Note: 1: 2262 2: Error 3: -2147287038
MSI (s) (C8:A0) [Time]: Transforming table Error.
MSI (s) (C8:A0) [Time]: Note: 1: 2262 2: Error 3: -2147287038
MSI (s) (C8:A0) [Time]: Transforming table Error.
MSI (s) (C8:A0) [Time]: Note: 1: 2262 2: Error 3: -2147287038
MSI (s) (C8:A0) [Time]: Transforming table Error.
MSI (s) (C8:A0) [Time]: Transforming table Error.
MSI (s) (C8:A0) [Time]: Note: 1: 2262 2: Error 3: -2147287038
MSI (s) (C8:A0) [Time]: Transforming table Error.
MSI (s) (C8:A0) [Time]: Note: 1: 2262 2: Error 3: -2147287038
MSI (s) (C8:A0) [Time]: Transforming table Error.
MSI (s) (C8:A0) [Time]: Note: 1: 2262 2: Error 3: -2147287038
MSI (s) (C8:A0) [Time]: Product: Microsoft SQL Server 2005 — Configuration failed.
MSI (s) (C8:A0) [Time]: Attempting to delete file C:\WINDOWS\Installer\46000.msp
MSI (s) (C8:A0) [Time]: Unable to delete the file. LastError = 32MSI (s) (C8:A0) [11:15:21:922]: Cleaning up uninstalled install packages, if any exist
MSI (s) (C8:A0) [Time]: MainEngineThread is returning 1603
MSI (s) (C8:F8) [Time]: Destroying RemoteAPI object.
MSI (s) (C8:98) [Time]: Custom Action Manager thread ending.
=== Logging stopped: Date and Time ===
MSI (c) (D8:04) [Time]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied.Counter after decrement: -1
MSI (c) (D8:04) [Time]: MainEngineThread is returning 1603
=== Verbose logging stopped: Date and Time ===SQL Server 2005 SP2When you install SQL Server 2005 SP2, you receive the following error message:

A recently applied update, KB921896, failed to install.Then, you continue the installation. Finally, Database Services and Analysis Services are not installed.The following error message is logged in the Summary.txt file:

Product: Database Services (SQL2005)
Product Version (Previous): 1399
Product Version (Final):
Status: Failure
Log File: C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG\Hotfix\SQL9_Hotfix_KB921896_sqlrun_sql.msp.log
Error Number: 29528
Error Description: MSP Error: 29528The setup has encountered an unexpected error while Installing performance counters. The error is: The specified driver is invalid.The following information is logged in the Hotfix.log file:

Date and Time Installing file: sqlrun_sql.msp
Date and Time Copy Engine: Creating MSP install log file at: C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG\Hotfix\SQL9_Hotfix_KB921896_sqlrun_sql.msp.log
Date and Time MSP Error: 29528The setup has encountered an unexpected error while Installing performance counters. The error is: The specified driver is invalid.
Date and Time MSP returned 1603: A fatal error occurred during installation.
Date and Time Copy Engine: Error, unable to install MSP file: e:\ddf143eddce69fe41b19cf97ff46\HotFixSQL\Files\sqlrun_sql.msp
Date and Time The following exception occurred: Unable to install Windows Installer MSP fileDate:
Date and TimeFile: \depot\sqlvault\stable\setupmainl1\setup\sqlse\sqlsedll\copyengine.cppLine: 800The following error message is logged in the SQL9_Hotfix_KB921896_sqlrun_sql.msp file:

<Func Name=’Do_sqlPerfmon2′>
<EndFunc Name=’Do_sqlPerfmon2′ Return=’2001′ GetLastError=’2′>
PerfTime Stop: Do_sqlPerfmon2 : Tue Mar 27 14:49:19 2007
Gathering darwin properties for failure handling.
MSI (s) (70!34) [Time]: Transforming table Error.
MSI (s) (70!34) [Time]: Note: 1: 2262 2: Error 3: -2147287038
Error Code: 2001
MSI (s) (70!34) [Time]: Product: Microsoft SQL Server 2005 — Error 29528. The setup has encountered an unexpected error while Installing performance counters. The error is: The specified driver is invalid.
Error 29528. The setup has encountered an unexpected error while Installing performance counters. The error is: The specified driver is invalid.
<EndFunc Name=’LaunchFunction’ Return=’2001′ GetLastError=’0′>
MSI (s) (70:B8) [Time]: User policy value ‘DisableRollback’ is 0
MSI (s) (70:B8) [Time]: Machine policy value ‘DisableRollback’ is 0
Action ended Time: InstallFinalize. Return value 3
Resolution
The Setup program performs a find-and-replace operation on the following files:Perf-InstanceNamesqlctr.iniPerf-InstanceNamemsmdctr.ini file The find-and-replace operation is case sensitive. If the folder that you specify to install the component has the same name as the service name of the default instance of the component, many strings in the file will be replaced. Therefore, you receive the error message.