Question on DB_datawrite role

rr-4098 1,256 Reputation points
2024-05-10T01:23:01.8966667+00:00

I need to make sure a user account is SQL can add & remove data in a table but not drop a table or DB. The db_datawriter role should do this correct?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,860 questions
0 comments No comments
{count} votes

Accepted answer
  1. Rahul Randive 8,826 Reputation points Microsoft Employee
    2024-05-10T01:38:54.25+00:00

    Hi rr-4098

    Correct. The db_datawriter role in SQL Server provides users with the ability to add, modify, and delete data in all user tables within a database. However, it does not provide users with the ability to drop tables or databases.

    To drop the table, Requires ALTER permission on the schema to which the table belongs, CONTROL permission on the table, or membership in the db_ddladmin fixed database role.

    Thank You!

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. CosmogHong-MSFT 23,556 Reputation points Microsoft Vendor
    2024-05-10T02:24:19.2+00:00

    Hi @rr-4098

    The db_datawriter role should do this correct?

    Yes.

    Members of the db_datawriter fixed database role can add, delete, or change data in all user tables. In most use cases this role will be combined with db_datareader membership to allow reading the data that is to be modified.

    See this doc: Fixed-database roles

    Best regards,

    Cosmog Hong


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments