KB924291 - 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"

Bug #: 1209 (SQL Hotfix)
Bug #: 443526 (SQLBUDT)

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.

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=supportNote 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.

File name

File version

File size

Date

Time

Platform

Hauresourcedb.ldf

Not Applicable

524,288

17-Aug-2006

10:39

Not Applicable

Hauresourcedb.mdf

Not Applicable

39,911,424

17-Aug-2006

10:39

Not Applicable

Logread.exe

2005.90.2183.0

398,112

17-Aug-2006

14:13

x86

Microsoft.analysisservices.adomdclient.dll

9.0.2183.0

543,520

17-Aug-2006

14:13

x86

Microsoft.analysisservices.deployengine.dll

9.0.2183.0

138,016

17-Aug-2006

14:12

x86

Microsoft.analysisservices.dll

9.0.2183.0

1,215,264

17-Aug-2006

14:13

x86

Microsoft.sqlserver.mgdsqldumper.dll

2005.90.2183.0

75,552

17-Aug-2006

14:11

x86

Microsoft.sqlserver.sqlenum.dll

9.0.2183.0

908,064

17-Aug-2006

14:13

x86

Msgprox.dll

2005.90.2183.0

197,920

17-Aug-2006

14:11

x86

Msmdlocal.dll

9.0.2183.0

15,703,840

17-Aug-2006

14:13

x86

Msmdredir.dll

9.0.2183.0

3,968,800

17-Aug-2006

14:14

x86

Replprov.dll

2005.90.2183.0

547,616

17-Aug-2006

14:13

x86

Replrec.dll

2005.90.2183.0

782,112

17-Aug-2006

14:12

x86

Sqlaccess.dll

2005.90.2183.0

347,936

17-Aug-2006

14:13

x86

Sqlagent90.exe

2005.90.2183.0

319,264

17-Aug-2006

14:12

x86

Sqlservr.exe

2005.90.2183.0

28,959,064

17-Aug-2006

14:13

x86

Sysdbupg.sql

Not Applicable

192,346

19-Jul-2006

09:02

Not Applicable

Template_hauresourcedb.ldf

Not Applicable

524,288

17-Aug-2006

10:39

Not Applicable

Template_hauresourcedb.mdf

Not Applicable

39,911,424

17-Aug-2006

10:39

Not Applicable

Xpstar90.dll

2005.90.2183.0

292,640

17-Aug-2006

14:16

x86

Xpstar90.rll

2005.90.2183.0

152,864

17-Aug-2006

14:12

Not 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)

Need more help?

Expand your skills
Explore Training
Get new features first
Join Microsoft Insiders

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.

×