BUG: SEM Scripts of User Table Permissions Do Not Have Owner
Article ID: 182449
Article Last Modified on 3/14/2005
APPLIES TO
- Microsoft SQL Server 6.5 Standard Edition
This article was previously published under Q182449
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: kbbug kbpending KB182449