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 2005 Forums
 SQL Server Administration (2005)
 Permissions via Views

Author  Topic 

lotek
Starting Member

42 Posts

Posted - 2009-01-23 : 19:22:53
I have a situation where i would like certain users to be able to query a view in database A. The view in database A actually pulls that data from database B which i do not want the user to have permission to. How can this be accomplished? I get the error:

Msg 916, Level 14, State 1, Line 1
The server principal "User1" is not able to access the database "database B" under the current security context.

Thoughts?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-01-24 : 00:49:57
You must give the user access to the underlying object in databaseB. This would be required even if you were using a stored procedure.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -