Instagram
youtube
Facebook
Twitter

MS SQL Server- Drop Database

MS SQL Server DROP DATABASE

  • Drop database means permanently deleting the database including its table, indexes, and constraints.
  • There are two ways to drop a database: SQL Server Management Studio and Transact-SQL Command.

Using SQL Server Management Studio

  • In Object Explorer, click on the '+' to expand the Database folder.
  • Right-click on the database you wish to delete and then select the delete option.
  • After clicking the delete option, a dialog box appears to confirm the deletion process .click on OK
  • Once the database is deleted, click on refresh or press F5 and see the name of the database will disappear.

Using Transact-SQL Command

  • Select new Query on the standard bar.
  • Type the following query and select the query and click on execute on the standard bar.
DROP DATABASE IF EXISTS database_name;
  • If you want to delete multiple databases at a time using a single query
DROP DATABASE IF EXISTS database_name,database_name2....;

Once the database is deleted, click on refresh or press F5 and see the name of the database will disappear.