/****** Object: StoredProcedure [dbo].[sp_DeleteAllData] Script Date: 06/24/2016 10:15:40 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[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
时间: 2024-10-14 06:19:38