Hi,
I came across undocumented system stored procedure sp_MSForEachTable.
Try this to delete all data from all tables in a given database.
Please Test it.
EXEC sp_MSForEachTable ‘ALTER TABLE ? NOCHECK CONSTRAINT ALL’
EXEC sp_MSForEachTable ‘DELETE FROM ?’
EXEC sp_MSForEachTable ‘ALTER TABLE ? CHECK CONSTRAINT ALL’
Thanks ,
Prem