BUG: DOC Error: DNR and Compilation Section Incorrectly States Stored Procedures Do Not Execute

ID: Q240678


The information in this article applies to:
  • Microsoft SQL Server version 7.0

BUG #: 56159 (SQLBUG_70)

SYMPTOMS

SQL Server Books Online states the following in the Deferred Name Resolution and Compilation section:


   If the objects referenced by the stored procedure are missing when the
   stored procedure is executed, or if other errors are found in the
   resolution stage, an error is returned and the stored procedure does not
   execute. 
This is not correct. The stored procedure actually executes up to the line that generates the syntax error.


STATUS

Microsoft has confirmed this to be a problem in SQL Server version 7.0.


MORE INFORMATION

Use the following example to demonstrate the behavior:


CREATE TABLE test (col1 CHAR(10))
GO

CREATE PROC test1 AS
BEGIN
   INSERT INTO test VALUES ('test #1')
   SELECT * FROM missingtable
END
GO

EXEC test1
GO

SELECT *
FROM test
GO 
The second SELECT shows that "test #1" was inserted into the test table.

Additional query words:

Keywords : kbSQLServ700bug kbCodeSnippet
Version : winnt:7.0
Platform : winnt
Issue type : kbbug


Last Reviewed: November 11, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.