Share via

Disable read access in SQL DB while keeping write permissions on an account

Vishwanatha Chilla 20 Reputation points
2023-05-03T20:49:42.2466667+00:00

Is it possible to disable read/select access in SQL server while keeping write access to an account?

SQL Server | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories

0 comments No comments

Answer accepted by question author

Erland Sommarskog 134.7K Reputation points MVP Volunteer Moderator
2023-05-03T21:48:26.9633333+00:00

Starting point is that a user has no permissions at all in the database. If you only want the user to be able to write data, you would do:

GRANT INSERT, UPDATE, DELETE ON tbl TO someuser

Rather than a table, you can also specify a schema (SCHEMA::dbo) or leave the ON clause to give permissions to all tables in the database.

If you already have granted the user permissions, start with removing those. This may include taking the user out of roles.

There is also a DENY command, but you can easily shoot yourself in the foot with that command, so avoid it as long as possible.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.