question

Katie 1 avatar image
Katie 1 asked

Drop database vs delete database

Guys,

This question is purely out of curiosity. I am actually using sql server 2008 standard version. I am accustomed to use DROP DATABASE DBNAME as my command to drop a database. But recently noticed that when you do a right click on the database in SSMS, found a 'delete'.I was confused as programatically, there are difference between Drop and Delete. Wondered if that was applicable to the database administartion too, Utimately, it does makes the database vanish, but wondering, if there was any command like DELETE DATABASE DBNAME

Thanks

sql-server-2008
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Grant Fritchey avatar image
Grant Fritchey answered

No, there's no difference. It's issuing a DROP command. The SSMS gui is just gussied up so that people aren't confused by things that you take for granted in TSQL. You wouldn't issue a DELETE statement for a database because that has very specific meaning in TSQL.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

CirqueDeSQLeil avatar image CirqueDeSQLeil commented ·
+1 for using the word gussied
2 Likes 2 ·
Fatherjack avatar image Fatherjack ♦♦ commented ·
+1 - same here. Gussied-up is a very under used term and its good to see it used in this context. Well done Grant!
1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.