BUG: SEM Scripts of User Table Permissions Do Not Have Owner

ID: Q182449


The information in this article applies to:

BUG #: 1344 (starfighter65)

SYMPTOMS

When a user-created table with permissions is scripted in SQL Enterprise Manager, the script does not include the owner name in the GRANT statements which are produced. The resultant script fails to run and you receive the following error message:

Msg 208, Level 16, State 2
Invalid object name '<your table name>'.


WORKAROUND

Edit the script to add SETUSER statements before the permissions on the tables are executed. The SETUSER statement allows a database owner to impersonate another user. The SETUSER statement permits the system administrator or a database owner to adopt the identity of another user to allow use of someone else's database object, to grant permissions to that object, or to create an object.

Use the following syntax:


   SETUSER ['username' [WITH NORESET]] 


STATUS

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

Additional query words: SEM


Keywords          : SSrvEntMan kbbug6.50 
Version           : WinNT:6.5
Platform          : winnt 
Issue type        : kbbug 

Last Reviewed: April 20, 1999