Guillaume Lecanu
Guillaume Lecanu

Reputation: 36

Rights question on SQL Server 2008

I've got a database 1 with a user A with data_reader right on it.

I've got a database 2 with a user B wuth data_reader right on it and no access to database 1.

I need to :

Is it possible?

Upvotes: 1

Views: 50

Answers (1)

BradC
BradC

Reputation: 39916

Yes, this is called "cross-database ownership chaining", and can be a real pain.

The trick is to make sure that the following is set up:

  1. Both DB2.View and DB1.Table are owned by the same SQL user (obviously a user that has access to both databases, usually an admin user like SA).

  2. "Cross-database ownership chaining" is enabled on the server, or on the databases.

See http://msdn.microsoft.com/en-us/library/ms188676.aspx for a more detailed discussion, and a neat diagram.

Upvotes: 2

Related Questions