--*******************************************************
--* *
--* *
--* 2010-6-28 *
--*******************************************************
if exists (select * from sysobjects where type='P' and name=N'P_DeleteAllData' )
drop procedure P_DeleteAllData
go
CREATE PROCEDURE P_DeleteAllData
as
EXEC sp_MSForEachTable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL' --
EXEC sp_MSForEachTable 'ALTER TABLE ? DISABLE TRIGGER ALL' --
EXEC sp_MSForEachTable 'DELETE FROM ?' --
EXEC sp_MSForEachTable 'ALTER TABLE ? CHECK CONSTRAINT ALL' --
EXEC sp_MSForEachTable 'ALTER TABLE ? ENABLE TRIGGER ALL' --
go
--
--exec P_DeleteAllData --