BUG: RPC May Cause SQL Server to Generate Access Violation

Last reviewed: April 29, 1997
Article ID: Q114288

The information in this article applies to:

  - Microsoft SQL Server version 4.2
BUG# NT: 748 (4.2)

SYMPTOMS

When a Remote Procedure Call (RPC) is made to execute a stored procedure which updates a table with a trigger containing a call to another stored procedure which in turn contains an unmatched COMMIT TRAN or ROLLBACK TRAN statement, SQL Server may generate an Access Violation and terminate.

This does not happen if the ROLLBACK TRAN or COMMIT TRAN statement itself is contained in the trigger, instead of being in the stored procedure that is called by the trigger.

For example, consider the following script:

   CREATE TABLE testtrig ( i INT,  j INT )
   go
   CREATE PROC myproc @P0 INT, @P1 INT, @P2 INT AS
    UPDATE testtrig SET i=@P0,j=2 WHERE i=@P1 AND j=@P2
   go
   CREATE PROC trigproc AS  ROLLBACK TRAN /* or a COMMIT TRAN */
   go
   CREATE TRIGGER trg ON testtrig FOR UPDATE AS
    EXECUTE trigproc
   go

Then executing myproc stored procedure remotely will cause SQL Server to terminate, generating an access violation.

WORKAROUND

TO workaround this problem, avoid calling the stored procedure within the trigger if it contains an unmatched rollback (or commit). Instead, place the rollback (or commit) directly within the trigger.

STATUS

Microsoft has confirmed this to be a problem in SQL Server version 4.2 for Windows NT. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Additional query words: Access VB Visual Basic ODBC gp-fault trap
Keywords : kbbug4.20 kbprg SSrvWinNT
Version : 4.2
Platform : WINDOWS
Issue type : kberrmsg


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.