Resolved: Adding new tables, does it make sense to use IF NOT EXISTS
When creating a new table, does it make sense to use the IF NOT EXISTS command or is this redudant?
Hi David!
Thanks for reaching out.
In case there is such a DB you will obtain an error message that this database has already been created. Using IF NOT EXISTS
will check for this database and then create it. If you already have created it, you will obtain a warning message, but not an error message.
Hope this helps.
Best,
Tsvetelin
The word if exists is a checker that verfiy if the database or table existence on the server, sometimes We use the word 'Drop if exists' which means Delete the database or table if the database name or table name exists, Howevere, it's not adviceable to drop without backing up when there's an existing database or table on the server.