SQL Interview: 8: Why should you avoid the use of db_datareader and db_datawriter?
This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.
Section: Security Level: Intro
Question:
Many applications connect to SQL Server databases with users that are members of the db_datareader and/or db_datawriter roles?
Why should you avoid using those roles?
Answer:
db_datareader and db_datawriter are fixed database roles that were provided for convenience. They aren’t a good option from a security perspective.
2021-04-09