Deleting all rows from all tables for a specific Database in a SQL Server <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1899846/how-to-delete-all-rows-from-all-tables-in-a-sql-server-database">How to delete all rows from all tables in a SQL Server database?</a> </p> </blockquote> <p>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.</p> <p>I find this post with this query but not sure how it will work</p> <pre><code>EXEC sp_MSForEachTable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL' GO EXEC sp_MSForEachTable 'DELETE FROM ?' GO EXEC sp_MSForEachTable 'ALTER TABLE ? CHECK CONSTRAINT ALL' GO </code></pre> <p>My SQL Server name ServerBanta and Database name is DingDong2010.</p> <p>Taken from <a href="http://stackoverflow.com/questions/1899846/how-to-delete-all-rows-from-all-tables-in-a-sql-server-database">How to delete all rows from all tables in a SQL Server database?</a></p>