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



The information in this article applies to:

  • Microsoft SQL Server 7.0

This article was previously published under Q240678
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 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.

Modification Type:MajorLast Reviewed:10/16/2002
Keywords:kbBug kbCodeSnippet KB240678