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 2008 Forums
 Transact-SQL (2008)
 Access

Author  Topic 

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2013-07-30 : 14:39:05
I need a query to grant the read only access permissions to the AD group on the view object without having granting access to underlying tables of the view object.

The view had reference of other database table objects.

Thanks for your help..

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2013-07-30 : 14:55:09
GRANT SELECT ON ViewName TO SomeActiveDirectoryGroup

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

Subscribe to my blog
Go to Top of Page

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2013-07-31 : 12:12:06
Thanks Tara..

User has access denied issue on the underlying table after the granting the view access.

The view has dependant objects on other database tables on the same server..

Do i need to grant access on uderlying tables as well.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2013-07-31 : 13:08:27
I just tested it, and it works fine for me without any access to the underlying tables. Perhaps the user has been denied access somewhere. You'll need to sort that out.

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

Subscribe to my blog
Go to Top of Page

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2013-07-31 : 13:54:00
Here is the user reported error when executing the view..

The server principal "test\test" is not able to access the database "Dependent_view_table_database" under the current security context.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2013-07-31 : 14:16:16
Seems the user does not have permissions to the database. Add the user to the database and then grant the permission to the view.

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

Subscribe to my blog
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2013-07-31 : 14:23:00
Or you may need to google that error. Lots of weird solutions come up for it. Here's one: http://www.sqlservercentral.com/Forums/Topic550938-146-1.aspx

I would think that the user just needs to logout and then click the New Query button to run a query against the view. I suspect that this is a GUI-related error and that a New Query window will be okay to run commands.

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 -