Recently I had to drop all tables from a MSSQL Server Database, and this proved to be harder than expected because of foreign key contraints in the database. I found a post on how do disable them but that turned out to be not enough to allow to drop the tables. Instead I had to drop all the constraints from the database. The few lines below generate the commands to do this.
select 'ALTER TABLE ' + so.table_name + ' DROP CONSTRAINT ' + so.constraint_name from INFORMATION_SCHEMA.TABLE_CONSTRAINTS so