Grant table level read only permission on mssql

4 Jun

Step 1. Create role

CREATE ROLE read_only_role

Step 2. Generate sql query for all tables:

SELECT 'GRANT SELECT ON "' + TABLE_SCHEMA + '"."' + TABLE_NAME + '" TO "read_only_role"' FROM information_schema.tables

Step 3: Copy generated sql query from “Results” panel

Step 4: Paste copied sql query and run



Be Sociable, Share!

Comment Form

You must be logged in to post a comment.