TransWikia.com

Table access for all users and logins

Database Administrators Asked by thepieman314 on November 8, 2021

I have a server in which many users and logins already have access to

I was wondering if it is possible to allow all of these users and logins SELECT privilege to a specific table within a database?

2 Answers

You can use below command:

grant select on [Your_Table] to [public]

This grants SELECT permission on [Your_Table] to ALL existing and future users inside your database

If you do not want to grant select to Everyone (public) in the database, but rather to limited set of database users - in this case you need to create custom database role, grant select to this role, add users to this role

Update: additionally, if you log in to server as a "different user" (login) - make sure your login has a mapped user inside your database in question, and that user has "connect database" permission;

Answered by Aleksey Vitsko on November 8, 2021

The easiest way would be to create a role, assign that role select access to the table in question, then assign the users and logins to that role.

https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/database-level-roles?view=sql-server-ver15

Answered by bbaird on November 8, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP