HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

GRANT DROP ON TABLE springbootdb.* TO AdminUser

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
springbootdbadminusergrantdroptable

Problem

I've created an MsSQL database to serve a springboot application.

I want to grant something like the following permission to an admin user:

GRANT DROP ON TABLE springbootdb.* TO AdminUser


How can I assign this using Server Management Studio?

Solution

There isn't a specific "drop table" permission. But you can give them control on the schema using:

GRANT CONTROL ON SCHEMA::springbootdb TO AdminUser;


This allows them to drop any table in that schema, but also to do all kinds of other things you might not intend. You can take some of those things away with more granular DENY permissions, or with reactionary tools like DDL triggers (which can roll back operations based on the object and user).

Code Snippets

GRANT CONTROL ON SCHEMA::springbootdb TO AdminUser;

Context

StackExchange Database Administrators Q#166437, answer score: 4

Revisions (0)

No revisions yet.