Can You DROP Offline Database? – Interview Question of the Week #144

Question: Can You DROP Offline Database?

Answer: Ofcourse Yes.

Before you jump and say you knew this one. Well, super. As I always say you know your stuff.

Now for the rest of the people who did not know about this, let me give some context behind this question.

I have heard this question multiple times in recent interviews which I help conduct an organization. Everytime when this question was asked, most of the DBAs and users answered that – “As offline databases are not accessible, they can’t be deleted.”

The reality is that most of the users are confused with the word OFFLINE. When people hear the word “Offline”, they automatically assume that the it makes that particular device inaccessible. This is also true in most of the cases. For example, when the network or internet is offline, it is not accessible.

However, for SQL Server, when it is not offline, it also does not allow you to access the database. To see the error, let us first create the database and attempt to access it.

-- Create Database
-- Take the Database Offline
/*Now try to access the database it will give you error*/

You can see in the above error that it clearly tells us that the database is not accessible.

However, if you run the following script, it will drop the database successfully.


So in SQL Server, we can DROP any OFFLINE database if we have sufficient permissions.

Reference: Pinal Dave (

Previous Post
How to Create Primary Key Without ANY Index? – Interview Question of the Week #143
Next Post
What are Forwarded Records in SQL Server? – Interview Question of the Week #145

Related Posts

2 Comments. Leave new

Leave a Reply Cancel reply

Exit mobile version