PRB: Error Creating Stored Procedure

ID: Q42624


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


SYMPTOMS

When using the following procedure as a stored procedure:


   Create procedure workshop as
   use pubs
   select * from authors 
after pressing the CTRL+E keys in Query Analyzer, the following error message is displayed:
Server: Msg 154, Level 15, State 1, Procedure workshop, Line 2 A USE DATABASE statement is not allowed in a procedure or trigger.
Deleting the USE PUBS command returns the following error message:
Server: Msg 208, Level 16, State 1, Procedure workshop, Line 2 Invalid object name 'authors'.

Additional query words:

Keywords : kbprg SSrvStProc
Version : winnt:7.0
Platform : winnt
Issue type : kbprb


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