I've got 2 databases which are very important for our organization. I would like to prevent an accidental drop/delete of them… Do you have any suggestion? I was thinking about asking a password before perform the drop. Is this possible in MS SQL Server?
SQL Server – Ask for Password Before Dropping Specific Database
passwordsql server
Related Question
- Sql-server – SQL Azure: Drop Constraint and Index
- SQL Server TDE Encryption State 4 – Troubleshooting
- Sql-server – SQL Script to Drop old AD logins, Inactive SQL Logins and all related Users
- SQL Server 2014 – Different Password Hash Issue
- Prevent Database Deletion from SSMS GUI – How to
- SQL Server 2016 – How to Drop a Procedure Across Multiple Databases
- Postgresql – Set up a postgres database with a specific role without password prompt
- SQL Server – Query to Retrieve Login Password Length
Best Answer
You are operating in a very risky security environment by sharing a single user with all permissions. The quickest solution is to revoke DB_Owner on the shared account for each database but leave reader/writer/ddladmin/backupoperator/accessadmin. That will prevent the shared User from dropping any databases they are attached to but should still have control over all the innards of those particular databases. If you need a User aside from your System Admin accounts that can drop databases you can create it separately and only use it when necessary.