标签:
--CREATE PROCEDURE sp_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‘
--EXEC sp_MSFOREACHTABLE ‘SELECT * FROM ?‘
--GO
exec sp_DeleteAllData
标签:
原文地址:http://www.cnblogs.com/flyfish2012/p/4278578.html