SQL Server: drop table cascade equivalent?

前端 未结 6 1480
难免孤独
难免孤独 2020-11-29 06:14

In oracle, to drop all tables and constraints you would type something like

DROP TABLE myTable CASCADE CONSTRAINTS PURGE;

and this would co

6条回答
  •  攒了一身酷
    2020-11-29 06:38

    Ultimately we are deleting our table. So we can simply run 2 following command:

    ALTER TABLE ... DROP CONSTRAINT ...

    DROP TABLE ...

    1> ALTER TABLE PRJ_DETAILS DROP CONSTRAINT FK_PRJ_TYPE;

    -- Table name and Constraint Name are the parameter

    2> DROP TABLE .

    First drop constraint with its name associated with it table Second you can drop table.

    It worked for me and its easy also.

提交回复
热议问题