Microsoft KB Archive/101143

From BetaArchive Wiki

BUG: Permission Denied When USE TEMPDB Issued from SQL

Q101143



The information in this article applies to:


  • Microsoft SQL Server version 4.2x



BUG# 8882 (4.2)


SYMPTOMS

If a temporary table created by a user currently exists, then other users, including the System Administrator (SA), will get the following error message from SQL Administrator when issuing 'use tempdb' or choosing 'change database' from the query window:


   SELECT permission denied on object #temptable_sunfix', database
   tempdb, owner DBO. (msg 229, severity 14, state 2) 


NOTE: The error message indicates that the owner of the temporary table is DBO (database owner), which is not true if the temporary table is created by a user.


Example

Log in as a user, then type the following:


   create table #test(a int)
   go 


Leave the connection there, then log in as SA from SQL Administrator, and from query window, type the following:


   use tempdb
   go 


You will then get the error message 229.



WORKAROUND

Use SAF or isql to switch to tempdb. Or use fully qualified names when referring objects in tempdb.



STATUS

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

Keywords : kbtool
Issue type :
Technology : kbSQLServSearch kbAudDeveloper kbSQLServ420OS2


Last Reviewed: March 18, 1999
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.