Possible Duplicate:
How to delete all rows from all tables in a SQL Server database?
I want to delete all rows from a SQL Server 2005 database.
Can anyone to define a procedure to delete all rows from database by using single query?
Possible Duplicate:
How to delete all rows from all tables in a SQL Server database?
I want to delete all rows from a SQL Server 2005 database.
Can anyone to define a procedure to delete all rows from database by using single query?
In that case, this 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
thanks @MAT