How to clear SQL Server database
Database Journal just published a very useful script to Truncate Database by Shane Lively. What I found also interesting there – that you can disable constraints/triggers for certain table using ALTER TABLE MyTable NOCHECK CONSTRAINT ALL and ALTER TABLE MyTable DISABLE TRIGGER ALL, and reset identity seed using DBCC CHECKIDENT ("MyTable", RESEED, 0). But what I don’t understand – why author uses Delete instead of Truncate, which is faster and more efficient?



0 Comments:
Post a Comment
Links to this post:
Create a Link
<< Home