Give one user read only access to one table only

  • Hi,

    I have created an new SQL user User1 and tick one of databases DB1 in user manpping and it is only in public role by default. I thought this user should not have any permission upto this stage. But I found I can query all the tables. Why is that? If so, how can I only give this user to read access to only 1 table in DB1?

    Thanks

  • someone must have granted at least read to public ( for the tables ).

     

    • This reply was modified 2 years, 3 months ago by  Johan Bijnens.

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • Johan Bijnens wrote:

    someone must have granted at least read to public ( for the tables ).

    Either that or the user is a part of an AD User Group that has been granted such privs in the SQL Server.

    Going by memory and IIRC, you can execute xp_LoginInfo "userdomanin\username", "ALL" it it will tell you all the SQL Server "paths" of permissions.  See the following link for more detailed information...

    https://duckduckgo.com/?q=xp_logininfo+(Transact-SQL)

     

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • This was removed by the editor as SPAM

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply