In this article, we would like to show you how to
DROP database in MS SQL Server.
DROP DATABASE [database_name];
DROP DATABASE example
In this example, we will drop database named
DROP DATABASE [diraskDB];
DROP DATABASE IF EXISTS example
You can optionally add
IF EXISTS statement, so if the database doesn't exist you won't get an error.
DROP DATABASE IF EXISTS [diraskDB];
If you try to drop database that doesn't exist with
DROP DATABASE query you will get an error:
If you try to
DROP DATABASE IF EXISTS you will get a warning instead: