Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Cross database permission question

Author  Topic 

datagod
Starting Member

37 Posts

Posted - 2006-05-12 : 13:54:14
I am having difficulty understanding the following problem:

A user account has execute permission on stored procedure "ap_Proc" in database A.

"ap_Proc" executes a select statement against a view "vTheView" in database B.

"vTheView" in turn contains a join back to table "MyTable" in database A, which the user account has NOT been granted any access to.

The stored proc fails, reporting that the user does not have permission to access the MyTable table.

Now if the stored procedure had the select against "MyTable", everything would have worked fine.

Why does this problem happen? I don't want to grant select access to the "MyTable".

How can I still use this view?

Thanks for the help.

efelito
Constraint Violating Yak Guru

478 Posts

Posted - 2006-05-12 : 14:16:22
I haven't had a chance to try this senario out, but just out of curiosity, is cross database ownership chanining enabled?

Jeff Banschbach, MCDBA
Go to Top of Page

datagod
Starting Member

37 Posts

Posted - 2006-05-12 : 14:33:34
No it is not, and I believe that might be the problem. I just found an knowledge base article:810474 that summed up what I am seeing.
Go to Top of Page

datagod
Starting Member

37 Posts

Posted - 2006-05-15 : 11:25:33
Even after setting up cross database ownership for the two databases in question, I was still getting the errors.

Then I checked who actually owned the databases. It wa not SA as I had assumed, it was two previous DBA's. Changed ownership to SA, problem solved.

I hope this saves somebody out there some frustration...
Go to Top of Page
   

- Advertisement -