FIX: Stored Procedure Can't Be Upgraded

Last reviewed: June 27, 1997
Article ID: Q164287
The information in this article applies to:

- Microsoft SQL Server, versions 6.5 BUG #: 14451 (Windows NT: 6.5)

SYMPTOMS

If a Microsoft SQL Server 6.0 database contains a stored procedure that references a view contained in a SELECT INTO statement, the upgrade process for the database may fail with the following errors when running sp_db_upgrade3 (with results found in the Upgrad1b.out file in the Mssql\Install directory or directly from LOAD DATABASE or sp_db_upgrade):

  • Msg 2821, Level 16, State 2 You must drop and recreate procedure zview.
  • Msg 4401, Level 16, State 2 View 'zview' no longer exists
  • Msg 208, Level 16, State 1 Invalid object name '#x' Error occurred upgrading object myproc in database <name>, please drop And recreate.

WORKAROUND

To work around this problem, drop and re-create the procedure.

STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.5. This problem has been corrected in U.S. Service Pack 3 for Microsoft SQL Server version 6.5. For more information, contact your primary support provider.

MORE INFORMATION

The following is a sample script to demonstrate objects that exhibit this problem:

   use pubs
   go
   create table mytab (col1 int)
   go
   create view zview as select * from mytab
   go
   create proc myproc as
   select *
   into #x
   from zview
   select * from #x
   go


Additional reference words: dbcc upgradedb
Keywords : kbbug6.50 kbsetup SSrvInst SSrvStProc kbbuglist
Version : 6.5
Platform : WINDOWS
Issue type : kbbug
Resolution Type : kbfix


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: June 27, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.