Sunday, June 28, 2015

SQL Server 2016 - Truncate at Partition level

Enhancements to TRUNCATE in SQL Server 2016:

SQL Server 2016 introduced truncation at partition level without logging at the individual rows.
This is kind of having WHERE clause to DELETE statement.

The new TRUNCATE statement in SQL Server 2016 is:

TRUNCATE TABLE dbo.PartitionedTable
WITH (PARTITIONS (2, 4, 6 TO 8))

Above statement will truncate all the partitions 2, 4, 6, 7 and 8.



Labels: , , , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home