Delete row if table exists SQL

后端 未结 9 891
旧时难觅i
旧时难觅i 2021-01-17 10:36

I have a script that drops a load of tables using DROP TABLE IF EXISTS, this works.

There is also a delete in this script to DELETE a row from another table that I d

9条回答
  •  隐瞒了意图╮
    2021-01-17 10:54

    For MySQL

    show tables like "test1";
    

    For SQL Server

    SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'testSchema' AND     TABLE_NAME = 'test1'
    

提交回复
热议问题