BUG: DDL in Stored Procedure Can Cause Access Violation

Last reviewed: May 2, 1997
Article ID: Q150460

The information in this article applies to:
  • Microsoft SQL Server, version 6.0
BUG#: 13884 (6.00)

SYMPTOMS

Creating a stored procedure, view, default, rule, or trigger from a stored procedure with an EXEC command causes a handled exception that terminates the client thread if the command is greater than 255 bytes.

WORKAROUND

Create all non-table objects outside stored procedures.

STATUS

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

MORE INFORMATION

The SQL Server 6.0 "Developer's Companion" (page 203, chapter 6) states that a stored procedure can not create procedures, views, defaults, rules, and triggers. If a stored procedure is created within a stored procedure the following error will occur:

   Msg 111, Level 15, State 1
   CREATE PROCEDURE must be the first command in a query batch.


Additional query words: sproc sp view default trigger rule
Keywords : kbbug6.00 kbprg SSrvStProc
Version : 6.0
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: May 2, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.