How can we remove the drop permission from a user or a role like dbowner
? Want to restrict the dbowner
from dropping the database.
Sql-server – Drop permission from a dbowner
permissionssql server
Related Question
- SQL Server Error 615 – db_owner Unable to Drop Database
- Sql-server – DROP LOGIN fails on SQL Server 2014
- Sql-server – How to deny drop, delete permission for a table
- Sql-server – SQL Server – drop user triggered silent revoke of privileges
- Sql-server – Does SSRS report user needs database level permission
- SQL Server – How to Remove dbcreator Server Role
Best Answer
Even if you meant Sql Server and just mis-spelled db_owner, the answer holds true for any database: use the principle of least priviledge. That is, if an user shouldn't be able to drop the database, do not assign such privileges in the first hand at all.
Messing with built-in security group and role settings is bad practice, unless you are very sure what you are up to. Create new roles with appropriate settings instead. This way, you or any other DBA doesn't have to double-check if default permissions are really on default settings.
That being said, you might be able to prevent drops with some creative triggers. As how to do that, depends on your RDBMS.