SQL Server: Remove All Data From Database

— disable referential integrity:

EXEC sp_MSForEachTable ‘ALTER TABLE ? NOCHECK CONSTRAINT ALL’
GO

–delete the data:

EXEC sp_MSForEachTable ‘DELETE FROM ?’
GO

— enable referential integrity again:
EXEC sp_MSForEachTable ‘ALTER TABLE ? CHECK CONSTRAINT ALL’
GO