Possible Duplicate:
How to delete all rows from all tables in a SQL Server database?
I want to delete all rows from all tables for a specific database in a sql server which has 10's of other databases as well.
I find this post with this query but not sure how it will work
EXEC sp_MSForEachTable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL'
GO
EXEC sp_MSForEachTable 'DELETE FROM ?'
GO
EXEC sp_MSForEachTable 'ALTER TABLE ? CHECK CONSTRAINT ALL'
GO
My SQL Server name ServerBanta and Database name is DingDong2010.
Taken from How to delete all rows from all tables in a SQL Server database?