Microsoft KB Archive/42624

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 16:56, 18 July 2020 by 3155ffGd (talk | contribs) (importing KB archive)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Base


PRB: Error Creating Stored Procedure

Article ID: 42624

Article Last Modified on 3/2/2005



APPLIES TO

  • Microsoft SQL Server 7.0 Standard Edition



This article was previously published under Q42624

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'.

Keywords: kbprogramming kbprb KB42624