FIX: Calling Remote Stored Procedure Inside Local Stored Procedure While Passing Text Parameter Causes AV

This article was previously published under Q299366
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #:351307 (SHILOH_BUGS)
Calling a remote stored procedure inside a local stored procedure while passing a TEXT parameter may cause an access violation (AV) on the local server.

This problem has been isolated to the following conditions:
  • On the destination server, there is a stored procedure that accepts a TEXT (or NTEXT) parameter.
  • On the source server, there is a local stored procedure that calls the remote stored procedure on the destination server by fully qualified name while passing a TEXT (or NTEXT) parameter.
To resolve this problem, obtain the latest service pack for SQL Server 2000. For additional information, click the following article number to view the article in theMicrosoft Knowledge Base:
290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack
Modify the TEXT (or NTEXT) field directly, instead of making stored procedure calls.
Microsoft has confirmed that this is a problem in SQL Server 2000. This problem was first corrected in SQL Server 2000 Service Pack 1.

Steps to Reproduce Behavior

The following steps reproduce the problem on SQL Server 2000 build 8.00.194:
  1. On the source server, create a linked server for the destination server.
  2. Connect to the source server using Query Analyzer and run the following query:
    use pubsgoCREATE procedure sp_local@ptxtText TEXTasexec destination_servername here.pubs.dbo.sp_remote  @ptxtTextGO					
  3. On the destination server, create a stored procedure as follows:
    use pubsgocreate procedure sp_remote@ptxtTest TEXTasgo					
  4. Run the following query on the source server:
    sp_local 'mytest'					
    An access violation occurs on the source server.
-------------------------------------------------------------------------------Short Stack Dump00000000 Module(sqlservr+FFC00000)006D6FF9 Module(sqlservr+002D6FF9) (CXVariant::ClearDeep(void)+00000047)0040A849 Module(sqlservr+0000A849) (CXVariant::Clear(void)+0000000D)006134D6 Module(sqlservr+002134D6)(CExecParamTbl::ResetTextParams(void)+00000046)0079726F Module(sqlservr+0039726F) (CRuleCollection::LoadRules(class IMemObj *)+00004B19)-------------------------------------------------------------------------------				
AV; Remote Procedure Call

Article ID: 299366 - Last Review: 01/16/2015 22:40:15 - Revision: 3.2

Microsoft SQL Server 2000 Standard Edition

  • kbnosurvey kbarchive kbbug kbfix kbsqlserv2000sp1fix KB299366