3/25/2017 06:23:00 p. m.
Share:
Blog Informático sobre Análisis y Desarrollo de Software.
SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE TABLE_NAME = ‘NombreTabla’
EXEC sp_MSForEachTable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL' GO EXEC sp_MSForEachTable 'ALTER TABLE ? DISABLE TRIGGER ALL' GO EXEC sp_MSForEachTable 'BEGIN TRY TRUNCATE TABLE ? END TRY BEGIN CATCH DELETE FROM ? END CATCH;' EXEC sp_MSForEachTable 'ALTER TABLE ? CHECK CONSTRAINT ALL' GO EXEC sp_MSForEachTable 'ALTER TABLE ? ENABLE TRIGGER ALL' GO
0 comentarios: