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

Article translations Article translations
Article ID: 299366 - View products that this article applies to.
This article was previously published under Q299366
BUG #:351307 (SHILOH_BUGS)
Expand all | Collapse all

On This Page

SYMPTOMS

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.

RESOLUTION

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 the Microsoft Knowledge Base:
290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack

WORKAROUND

Modify the TEXT (or NTEXT) field directly, instead of making stored procedure calls.

STATUS

Microsoft has confirmed that this is a problem in SQL Server 2000. This problem was first corrected in SQL Server 2000 Service Pack 1.

MORE INFORMATION

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 pubs
    go
    
    CREATE procedure sp_local
    @ptxtText TEXT
    as
    exec destination_servername here.pubs.dbo.sp_remote  @ptxtText
    GO
    					
  3. On the destination server, create a stored procedure as follows:
    use pubs
    go
    
    create procedure sp_remote
    @ptxtTest TEXT
    as
    go
    					
  4. Run the following query on the source server:
    sp_local 'mytest'
    					
    An access violation occurs on the source server.
-------------------------------------------------------------------------------
Short Stack Dump
00000000 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)
-------------------------------------------------------------------------------
				

Properties

Article ID: 299366 - Last Review: November 5, 2003 - Revision: 3.2
APPLIES TO
  • Microsoft SQL Server 2000 Standard Edition
Keywords: 
kbbug kbfix kbsqlserv2000sp1fix KB299366

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