Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


User (db_datareader) can't see tables in MS; can SELECT data!


User (db_datareader) can't see tables in MS; can SELECT data!

Author
Message
Barkingdog
Barkingdog
SSC Eights!
SSC Eights! (909 reputation)SSC Eights! (909 reputation)SSC Eights! (909 reputation)SSC Eights! (909 reputation)SSC Eights! (909 reputation)SSC Eights! (909 reputation)SSC Eights! (909 reputation)SSC Eights! (909 reputation)

Group: General Forum Members
Points: 909 Visits: 916
We have an Acitve Directory user that is assigned db_datareader for a given database. Given any table name in the database the user can successfully issue (select * from tablename). BUT no tables or views appear for that user under Management Studio. He can expand the database but no tables appear.

I note the user has "dbo" as their default schema and the database does NOT contain that schema (i.e. all tables were created under specific named-schemas, not dbo). I even tried changing his default schema to one of the named ones but to no avail (he still can't list or enumerate the tables or views in this database.)

Any ideas what to check for next?

TIA,

Barkingdog

BTW: It is permission related. As a test I assigned the user to the db_dbowner role and he can see all tables and views.



Roy Ernest
Roy Ernest
SSCrazy
SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

Group: General Forum Members
Points: 2494 Visits: 6852
Just a question, Do you have any Deny VIEW DEFINITION or CONTROL permissions for that user?

-Roy
floyd.griffin
floyd.griffin
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 2
I am experiencing this same issue with MS SQL 2008 R2 SP1 SQL, anyone find a resolution?
Orlando Colamatteo
Orlando Colamatteo
SSCrazy Eights
SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)

Group: General Forum Members
Points: 8243 Visits: 14368
When logged in as this user, what do you get when you run:

SELECT  *
FROM sys.tables;



__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Ness
Ness
SSC Veteran
SSC Veteran (201 reputation)SSC Veteran (201 reputation)SSC Veteran (201 reputation)SSC Veteran (201 reputation)SSC Veteran (201 reputation)SSC Veteran (201 reputation)SSC Veteran (201 reputation)SSC Veteran (201 reputation)

Group: General Forum Members
Points: 201 Visits: 974
Roy gave the answer. This is expected behaviour if the login is not granted view definition

SQL DBA
Every day is a school day, and don't trust anyone who tells you any different.
http://sqlblogness.blogspot.co.uk
Orlando Colamatteo
Orlando Colamatteo
SSCrazy Eights
SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)

Group: General Forum Members
Points: 8243 Visits: 14368
Ness (6/17/2013)
Roy gave the answer. This is expected behaviour if the login is not granted view definition

Not exactly. Revoke (i.e. not being granted or denied a permission) is different than being explicitly denied a permission. If you have select permissions on a table you can see the metadata as well so the expectation is that if you are granted db_datareader then you should be able to see the metadata for all tables.

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
SilentMike
SilentMike
Old Hand
Old Hand (376 reputation)Old Hand (376 reputation)Old Hand (376 reputation)Old Hand (376 reputation)Old Hand (376 reputation)Old Hand (376 reputation)Old Hand (376 reputation)Old Hand (376 reputation)

Group: General Forum Members
Points: 376 Visits: 1345
Hi, I appreciate this is a pretty old thread but did you ever get to the bottom of this? I'm experiencing the same issue - a user is a member of the db_datareader role and is able to run select queries against the tables in the database with no issue. However, they are unable to view the list of tables in Object Explorer. They can however see the table list in Object Explorer Details.

The instance is still on SQL 2008R2 RTM so I'm hoping getting the Service Packs applied will fix this but any information you found would be appreciated.
Ness
Ness
SSC Veteran
SSC Veteran (201 reputation)SSC Veteran (201 reputation)SSC Veteran (201 reputation)SSC Veteran (201 reputation)SSC Veteran (201 reputation)SSC Veteran (201 reputation)SSC Veteran (201 reputation)SSC Veteran (201 reputation)

Group: General Forum Members
Points: 201 Visits: 974
See above:
Roy gave the answer. This is expected behaviour if the login is not granted view definition

SQL DBA
Every day is a school day, and don't trust anyone who tells you any different.
http://sqlblogness.blogspot.co.uk
SilentMike
SilentMike
Old Hand
Old Hand (376 reputation)Old Hand (376 reputation)Old Hand (376 reputation)Old Hand (376 reputation)Old Hand (376 reputation)Old Hand (376 reputation)Old Hand (376 reputation)Old Hand (376 reputation)

Group: General Forum Members
Points: 376 Visits: 1345
Thanks Ness but I don't think that solves my problem. The user has the exact same permissions (member of db_datareader only) on another database on the same instance and is able to view the table list in Object Explorer.

Even when I grant them VIEW DEFINITION on the database in question they are still unable to view the table list.
Smendle
Smendle
SSC-Enthusiastic
SSC-Enthusiastic (165 reputation)SSC-Enthusiastic (165 reputation)SSC-Enthusiastic (165 reputation)SSC-Enthusiastic (165 reputation)SSC-Enthusiastic (165 reputation)SSC-Enthusiastic (165 reputation)SSC-Enthusiastic (165 reputation)SSC-Enthusiastic (165 reputation)

Group: General Forum Members
Points: 165 Visits: 1065
SilentMike (5/20/2016)
Thanks Ness but I don't think that solves my problem. The user has the exact same permissions (member of db_datareader only) on another database on the same instance and is able to view the table list in Object Explorer.

Even when I grant them VIEW DEFINITION on the database in question they are still unable to view the table list.


I believe VIEW DEFINITION must go against MSDB.

You could also just give db_datareader access to MSDB but that may be too much access. Ive never found an issue doing this but some people are of the mind "Only give them what they need and not a bit more" where security is concerned.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search