locked
Delete database versus DROP database queries for azure sql database. RRS feed

  • Question

  • Delete database versus Drop database?  What is the difference?

    If DROP DATABASE query is used (rt  click the database to be dropped) the information is deleted in the database.   What is the reason to drop a database instead of deleting the database?

    https://www.w3schools.com/sql/sql_drop_db.asp

    using the above link I tried the query "SHOW DATABASES;" but the error  said there is no SHOW command?



    dsk


    • Edited by kimdav111 Thursday, August 22, 2019 10:37 PM
    Thursday, August 22, 2019 10:35 PM

Answers

  • Hi again kimdav,

    There is no command "DELETE DATABASE", but only "DROP DATABASE".

    You DELETE rows from a table for example, but you DROP a table or DATABASE

    When you CREATE entity (like table, or database) then you can ALTER it or DROP it - define the database (DDL = Data Definition Language).
    When you INSERT data then you can UPDATE it or DELETE it - manipulating the data (DML = Data Manipulation Language).

    The command "SHOW DATABASES" does not work on SQL Server but on servers like mariadb, MySQL, and so on

    In SQL Server you can use:

    SELECT * FROM sys.databases


    signature   Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]    [Linkedin]

    Friday, August 23, 2019 8:57 AM