Truncate

Tag: truncate

Does Truncate Table Reset Statistics?

Does Truncate Table Reset Statistics?

Short answer: the SQL Server optimizer will know that the table was truncated, but statistics might not update when you expect.

For the long answer, let’s walk through an example using the WideWorldImporters sample database.

Continue reading

Truncate Table with Partitions Fails if You Have Non-Aligned Indexes

Truncate Table with Partitions Fails if You Have Non-Aligned Indexes

on March 22, 2016

Category: indexing

SQL Server 2016 brought in a cool new little feature for table partitioning: you can now truncate individual partitions. There’s one little gotcha, though: you can only do this if all the indexes on the tables are “aligned”.

Continue reading