FIX: Error message when you execute a user-defined function in SQL Server 2005: "Invalid length parameter passed to the SUBSTRING function" or "A transport-level error has occurred when receiving results from the server"

Article translations Article translations
Article ID: 924291 - View products that this article applies to.
Bug #: 1209 (SQL Hotfix)
Bug #: 443526 (SQLBUDT)
Notice
Microsoft distributes Microsoft SQL Server 2005 fixes as one downloadable file. Because the fixes are cumulative, each new release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2005 fix release.
Expand all | Collapse all

On This Page

This article describes the following about this hotfix release:
  • The issues that are fixed by this hotfix package
  • The prerequisites for installing the hotfix package
  • Information about whether you must restart the computer after you install the hotfix package
  • Information about whether the hotfix package is replaced by any other hotfix package
  • Information about whether you must make any registry changes
  • The files that are contained in the hotfix package

SYMPTOMS

When you execute a user-defined function in SQL Server 2005, you receive an error message. This problem occurs if you run the following statement before you execute the user-defined function:
SET FMTONLY ON
You receive a different error message, depending on the version of SQL Server 2005 that you have installed. If you use SQL Server 2005 Service Pack 1 (SP1), you may also experience other problems.

The original release version of SQL Server 2005

When you execute the user-defined function in the original version of SQL Server 2005, you receive the following error message.
Msg 536, Level 16, State 5, Line 4
Invalid length parameter passed to the SUBSTRING function.

SQL Server 2005 SP1

When you execute the user-defined function in SQL Server 2005 SP1, you experience the following problems:
  • You receive the following error message:
    Msg 109, Level 20, State 0, Line 0
    A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 0 - The pipe has been ended.)
  • The SQL Server service stops.
  • The following access violation is logged in the SQL Server Errorlog file:
    SqlDumpExceptionHandler: Process 53 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.

RESOLUTION

Service pack information

To resolve this problem, obtain the latest service pack for SQL Server 2005. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
913089 How to obtain the latest service pack for SQL Server 2005

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. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.

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, contact 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 Web site:
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

You must have SQL Server 2005 Service Pack 1 (SP1) installed to apply this hotfix.

For more information about how to obtain SQL Server 2005 Service Pack 1, click the following article number to view the article in the Microsoft Knowledge Base:
913089 How to obtain the latest service pack for SQL Server 2005

Restart information

You have to restart the SQL Server service after you apply this hotfix.

Registry information

You do not have to change the registry.

Hotfix file information

This hotfix contains only those files that are required to correct the issues that this article lists. This hotfix may not contain of all the files that you must have to fully update a product to the latest build.

The English 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
Hauresourcedb.ldfNot Applicable524,28817-Aug-200610:39Not Applicable
Hauresourcedb.mdfNot Applicable39,911,42417-Aug-200610:39Not Applicable
Logread.exe2005.90.2183.0398,11217-Aug-200614:13x86
Microsoft.analysisservices.adomdclient.dll9.0.2183.0543,52017-Aug-200614:13x86
Microsoft.analysisservices.deployengine.dll9.0.2183.0138,01617-Aug-200614:12x86
Microsoft.analysisservices.dll9.0.2183.01,215,26417-Aug-200614:13x86
Microsoft.sqlserver.mgdsqldumper.dll2005.90.2183.075,55217-Aug-200614:11x86
Microsoft.sqlserver.sqlenum.dll9.0.2183.0908,06417-Aug-200614:13x86
Msgprox.dll2005.90.2183.0197,92017-Aug-200614:11x86
Msmdlocal.dll9.0.2183.015,703,84017-Aug-200614:13x86
Msmdredir.dll9.0.2183.03,968,80017-Aug-200614:14x86
Replprov.dll2005.90.2183.0547,61617-Aug-200614:13x86
Replrec.dll2005.90.2183.0782,11217-Aug-200614:12x86
Sqlaccess.dll2005.90.2183.0347,93617-Aug-200614:13x86
Sqlagent90.exe2005.90.2183.0319,26417-Aug-200614:12x86
Sqlservr.exe2005.90.2183.028,959,06417-Aug-200614:13x86
Sysdbupg.sqlNot Applicable192,34619-Jul-200609:02Not Applicable
Template_hauresourcedb.ldfNot Applicable524,28817-Aug-200610:39Not Applicable
Template_hauresourcedb.mdfNot Applicable39,911,42417-Aug-200610:39Not Applicable
Xpstar90.dll2005.90.2183.0292,64017-Aug-200614:16x86
Xpstar90.rll2005.90.2183.0152,86417-Aug-200614:12Not Applicable

WORKAROUND

To work around this problem, change the SET FMTONLY setting to OFF before you execute the user-defined function.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. This problem was first corrected in SQL Server 2005 Service Pack 2.

MORE INFORMATION

For more information about the naming schema for Microsoft SQL Server updates, click the following article number to view the article in the Microsoft Knowledge Base:
822499 New naming schema for Microsoft SQL Server software update packages
For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684 Description of the standard terminology that is used to describe Microsoft software updates

Stack dump information

You receive the following stack dump information in SQL Server 2005 SP1:
2006-08-16 19:30:37.61 spid54      * Short Stack Dump
2006-08-16 19:30:37.62 spid54      014718DE Module(sqlservr+004718DE)
2006-08-16 19:30:37.62 spid54      0108B032 Module(sqlservr+0008B032)
2006-08-16 19:30:37.62 spid54      0108B066 Module(sqlservr+0008B066)
2006-08-16 19:30:37.62 spid54      014680F2 Module(sqlservr+004680F2)
2006-08-16 19:30:37.62 spid54      01BDF9D2 Module(sqlservr+00BDF9D2)
2006-08-16 19:30:37.62 spid54      014688D5 Module(sqlservr+004688D5)
2006-08-16 19:30:37.62 spid54      01023E34 Module(sqlservr+00023E34)
2006-08-16 19:30:37.62 spid54      0136764A Module(sqlservr+0036764A)
2006-08-16 19:30:37.62 spid54      013674C1 Module(sqlservr+003674C1)
2006-08-16 19:30:37.62 spid54      01367356 Module(sqlservr+00367356)
2006-08-16 19:30:37.62 spid54      01BF2102 Module(sqlservr+00BF2102)
2006-08-16 19:30:37.62 spid54      01381DA5 Module(sqlservr+00381DA5)
2006-08-16 19:30:37.62 spid54      01023E34 Module(sqlservr+00023E34)
2006-08-16 19:30:37.62 spid54      01041DD5 Module(sqlservr+00041DD5)
2006-08-16 19:30:37.62 spid54      0103DFD4 Module(sqlservr+0003DFD4)
2006-08-16 19:30:37.62 spid54      01006A96 Module(sqlservr+00006A96)
2006-08-16 19:30:37.62 spid54      01006BBC Module(sqlservr+00006BBC)
2006-08-16 19:30:37.62 spid54      01006DAB Module(sqlservr+00006DAB)
2006-08-16 19:30:37.62 spid54      01447562 Module(sqlservr+00447562)
2006-08-16 19:30:37.62 spid54      0144859B Module(sqlservr+0044859B)
2006-08-16 19:30:37.62 spid54      0144789A Module(sqlservr+0044789A)
2006-08-16 19:30:37.64 spid54      01447720 Module(sqlservr+00447720)
2006-08-16 19:30:37.64 spid54      781329AA Module(MSVCR80+000029AA)
2006-08-16 19:30:37.65 spid54      78132A36 Module(MSVCR80+00002A36)

sqlservr!CMsqlXactImp::ClearAllUpdateSequenceMarkers+0x3b (CONV: thiscall)
sqlservr!CMsqlXactImp::RollbackInternal+0x3a (CONV: thiscall)
sqlservr!CMsqlXactImp::Rollback+0x31 (CONV: thiscall)
sqlservr!CAutoMsqlXact::RollbackNestedXact+0x1b (FPO: [0,0,0]) (CONV: thiscall)
sqlservr!CExecuteStatement::RollbackNestedXact+0x14 (FPO: [1,0,0]) (CONV: thiscall)
sqlservr!CExecuteStatement::FinishNormalImp+0x8c (CONV: thiscall)
sqlservr!CExecuteStatement::FinishOnExceptionImp+0x13 (CONV: thiscall)
sqlservr!CMsqlExecContext::FExecute+0x65c (CONV: thiscall)
sqlservr!CSQLSource::Execute+0x73b (CONV: thiscall)
sqlservr!process_request+0x2e3 (CONV: stdcall)
sqlservr!process_commands+0x2e0 (CONV: stdcall)
sqlservr!SOS_Task::Param::Execute+0xe2 (CONV: thiscall)
sqlservr!SOS_Scheduler::RunTask+0xb9 (CONV: thiscall)
sqlservr!SOS_Scheduler::ProcessTasks+0x141 (CONV: stdcall)
sqlservr!SchedulerManager::WorkerEntryPoint+0x1a8 (CONV: stdcall)
sqlservr!SystemThread::RunWorker+0x7f (CONV: thiscall)
sqlservr!SystemThreadDispatcher::ProcessWorker+0x225 (CONV: thiscall)
sqlservr!SchedulerManager::ThreadEntryPoint+0x143 (CONV: stdcall)
msvcr80!_callthreadstartex+0x1b (FPO: [Non-Fpo]) (CONV: cdecl)
msvcr80!_threadstartex+0x66 (FPO: [Non-Fpo]) (CONV: stdcall)

Properties

Article ID: 924291 - Last Review: October 9, 2011 - Revision: 2.0
APPLIES TO
  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Workgroup Edition
  • Microsoft SQL Server 2005 Enterprise Edition
Keywords: 
kbautohotfix kbsql2005sp2fix kbHotfixServer kbfix kbexpertiseadvanced kbqfe KB924291

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