best way to grant read only access to 2 tables in SQL Server 2005?
whats the best way to grant access to a few users to a couple tables in a SQL Server 2005 database?
I know the literature pushes the use of views but what is the gain over granting read only access to the actual table?
at least with the table there will be less overhead in that the index and other restraints are already in place and managed at the table (a single point of maintenance). If I make views then won't开发者_如何学运维 i need to maintain them and create indexes on them... as well as this will be additional overhead for SQL itself?
CREATE ROLE role_name
GRANT SELECT ON table_name TO role_name
Don't forget to add users to that role. Adding individual permissions is generally a bad practice.
Using views and giving permissions to the view is useful if you want to hide particular columns / name columns in different ways / otherwise filter the data.
精彩评论