Running a DROP statement on an SQL Server is never an easy task as far as the numbers of thoughts that run in our mind at the time of doing that are considered.
So, here is writing up on the process that we need to follow while dropping a SQL Server Database.
Firstly, the decision process that you have to really go ahead and drop the database, if yes then create a checklist of your own with the below as a starting point to it.
1. Check if any application is using the database,the chance is that they need to be pointed to a new upgraded database or the application is obsolete now and simply needs to be removed.
2. Check if any other databases are using objects of this database.
3. Check if you have any Database Level Triggers on this particular database.
4. Check if you have any Maintenance plans, exclusively referring this database.
5. Check if you have any MS SQL Server Agent Jobs referring this database exclusively.
6. Check if you have any Database Snapshots, if yes, Drop the database snapshots on the database.
7. Check if you have log shipping configured, If the database is involved in log shipping, remove log shipping before dropping the database.
8. Get a thumbs up from the owner of the database
9. Check if there are any existing users. If yes, notify them, or if they are long running check what operation they are trying to do and kill them.
10. Preferably, get the database to SINGLE_USER mode.
11. Take a full backup with “verify the backup” option on, rather take multiple copies with at least one being offsite.
12. Create a script of all the Logins in that database, in case you may miss the logins at the place of Restoration.
13. Take a backup of the master database.
14. Drop the database.
15. Take a backup of the master database.
Now for some basic points
Syntax: DROP DATABASE Database Name
For deleting a database you need to at least have CONTROL permission on the database.
We can delete a database regardless of its state – Offline, Read-only or Suspect or any other.
If you have liked the article and want to get the articles (or) new posts at sql like, subscribe to articles through email by entering your email address in the top right and verifying the same. if you have any comments, then the below form is for you, go ahead!!!
{ Comments on this entry are closed }