How to drop a list of SQL Server tables, ignoring constraints?

后端 未结 6 1188
醉梦人生
醉梦人生 2021-02-12 21:47

I have a list of half a dozen MSSQL 2008 tables that I would like to remove at once from my database. The data has been entirely migrated to new tables. There is no reference in

6条回答
  •  醉话见心
    2021-02-12 22:14

    I finally found the solution based on the script provided by Jason Presley. This script automatically removes all constraints in the DB. It's easy to add a WHERE clause so that it only applies to the set of concerned tables. After that, dropping all tables is a straightforward.

提交回复
热议问题