RE: cross database query with ownership chaining
- From: changliw@xxxxxxxxxxxxxxxxxxxx ("Charles Wang [MSFT]")
- Date: Thu, 05 Jun 2008 14:45:39 GMT
Hi Mark,
I just found a KB article talking about the error you encountered. If this
issue persists, please refer to this KB article to see if you are
encountering the same issue:
You cannot run a statement or a module that includes the EXECUTE AS clause
after you restore a database in SQL Server 2005
http://support.microsoft.com/kb/913423/en-us
As it stated that this problem occurs when all the following conditions are
true:
- You back up a database from an instance of SQL Server 2005. Then, you
restore the database to an instance of SQL Server 2005 that is installed on
another computer.
- The statement or the module is executed as the dbo (database owner) user.
- The owner of the database is a domain user or a SQL Server authorization
login.
Notes:
- If a domain user owns the database, the computer on which you restore the
database cannot access the domain.
- If a SQL Server authorization login owns the database, the login does not
exist in the new instance of SQL Server 2005.
The cause is that this problem occurs because SQL Server 2005 cannot obtain
the information about the context when you try to impersonate a database
user to run a statement or a module.
To work around this problem, change the database owner to a valid login or
domain user. To do this, run the following statements: USE <DatabaseName>
GO
sp_changedbowner '<NewLogin>'
We really appreciate your posting back and let us know the issue status. If
you have any further questions or concerns, please feel free to let us
know. We are very glad to assist you further.
Best regards,
Charles Wang
Microsoft Online Community Support
=========================================================
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg@xxxxxxxxxxxxxx
=========================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
=========================================================
.
- Prev by Date: Re: Certificate Requirements for SQL Data Encryption
- Next by Date: Re: Access to database through application only
- Previous by thread: Re: Access to database through application only
- Next by thread: RE: SQL Authentication
- Index(es):
Relevant Pages
|