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 ‘exception 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.

FIX: Stack Overflow Exception Error Occurs When You Insert 250 KB or More of Data Into a Text or Image Column

Symptoms
A stack overflow exception error may occur when you attempt either of the following tasks:
You insert 250 KB or more of data into a text or image column while SQL Server Profiler is running either of the following profiler events:
TSQL:SQL:StmtStarting
-or-
TSQL:SQL:StmtCompleted

You run a stored procedure that inserts 250 KB or more of data into a text or image column.
Resolution
Reduce the amount of data that you insert into the text or image column.

FIX: Exception Access Violation Encountered in CONSTANT::CONSTANT

Symptoms
Use of a query that involves the AN identity may result in the SQL Server client being forcefully disconnected and the following stack trace is reported in the SQL Server error log:

0×0043cc05 Module(sqlservr+3cc05) (CONSTANT::CONSTANT+6e)0×00782df9 Module(sqlservr+382df9) (trConstant::trConstant+31)0×005faad4 Module(sqlservr+1faad4) (PtrBldGetIdentity+125)0×00531660 Module(sqlservr+131660) (CCompPlan::Result+5dc)0×0044a4ab Module(sqlservr+4a4ab) (CCompPlan::FPreprocess+19c)0×004383d0 Module(sqlservr+383d0) (CCompPlan::FCompileStep+7e6)0×0043d00f Module(sqlservr+3d00f) (CProchdr::FCompile+5d9)…
Resolution
The CONSTANT::CONSTANT code line attempts to copy an extra character from the table name, which then causes the exception 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.

BUG: Xp_sendmail with Large Row Results May Cause Error 35909

Symptoms
Running xp_sendmail can cause SQLMail to get an exception error and stop ifall of the following conditions are true:
One of the rows returns more that 2,000 bytes.The @width parameter is set greater than 2,000The results are not attached as a file.
Resolution
To work around this problem, do either of the following:
Use the parameter @attach_results=true.
-or-Do not set @width greater than 2000.

Error message when you try to connect to SQL Server Compact 3.5 Service Pack 1 from SQL Server Management Studio in SQL Server 2008: “Unable to load Microsoft SQL Server Compact”

Symptoms
When you try to connect to MicrosoftSQL Server Compact 3.5 Service Pack1 (SP1) from SQL Server Management Studio in Microsoft SQL Server 2008, you may receive an exception error message that resembles the following:

Unable to load Microsoft SQL Server Compact. Install Microsoft SQL Server Compact MSIs from the folderServers\Setup on the SQL Server installation media. For more details, refer to KB Article 952218.
Resolution
This problem occurs because SQL Server Compact 3.5 SP1 or SQL Server Compact 3.5 SP1 Query Tools is not installed on the computer that is running SQL Server 2008.