+22
Completed

Drop DB and Tables Should have an `IF EXISTS` Option

m snoddy 5 years ago updated by anonymous 4 years ago 11 2 duplicates

When generating the SQL for a database there is an option to add DROP statements for TABLES and the schema, however if these don't have an IF EXISTS in the SQL statement, they won't work on the first run. It would be nice to have a check box for this to reduce manual editing.

Answer

Answer

Hi, the new version with Forward Engineer improvements has been rolled

Thank you for your assistance,

SqlDBM Team

Duplicates 2
+1
Accepted

Agree with you, having an option (checkbox) to have "Drop If Exists", would be nice to have.

Thank you for providing feedback. We will surely put it in our development pipeline.

Under review

Thank you for feedback, we will review this ticket soon

+3

It would likely be a net positive (and easy change) if this was made the default in the interim, until a checkbox and settings menu are implemented.

Investigating

We are glad you created this "Idea" ticket. We will discuss it with our team.

Thank you for your assistance,

SqlDBM Team

Agreed that this should be the default - any time you add a new table, the created script will fail! Would be nice to save the step of find and replace!

to have the script working in MS SQL2000 + use the:

IF OBJECT_ID('<schema>.<table>') IS NOT NULL

DROP TABLE  <schema>.<table>;

the Exist is only for SQL2016+ 

+1

This is a great idea, I always have the same DROP TABLE removal job on tables that do not yet exist. Could prioritize, seems to be simple.

Answer

Hi, the new version with Forward Engineer improvements has been rolled

Thank you for your assistance,

SqlDBM Team