BUG: Permissions Problem with Stored Procedure and Table

Last reviewed: April 28, 1997
Article ID: Q95287

The information in this article applies to:
  • Microsoft SQL Server version 4.2 for OS/2
  • Microsoft SQL Server, versions 4.21 and 4.21a
BUG# OS/2: 1581 (4.2)
       NT:   94 (4.2)

SYMPTOMS

After creating a stored procedure that selects from a table and a view into a temporary table, any attempt to execute this new stored procedure by any user other than the owner of the stored procedure results in an incorrect "permission denied" error. The other users getting the "permission denied" error were correctly granted execute permission on this new stored procedure.

The following example demonstrates the problem:

   create table t1 (c1 int)
   create table t2 (c2 int)

   create view v1 as select c2 from t2

   create procedure problem as
      select c1, c2 into #t1 from t1, v1

WORKAROUND

To work around the problem, first create the temporary table, and then insert the data into the temporary table:

   create procedure work_around as
     create table #t1 (c1 int, c2 int)
     insert #t1
        select c1, c2 from t1, v1

STATUS

Microsoft has confirmed this to be a problem in SQL Server version 4.2 for OS/2 and Microsoft SQL Server versions 4.21 and 4.21a. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Additional query words: Transact-SQL
Keywords : kbbug4.20 kbbug4.21 kbbug4.21a kbprg SSrvServer SSrvWinNT
Version : 4.2 | 4.21 4.21a
Platform : OS/2 WINDOWS


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