RE SQL Server Truncate Table

RE SQL Server Truncate Table

 

  


Truncate is not supposed to be able to be rolled back, as it deallocates the data files and makes their extents available for writing over. The actual deallocation is logged in the transaction log however, but technically TRUNCATE statements are not available for rollback. However if you put the truncate statement within a BEGIN TRAN - (ROLLBACK TRAN) COMMIT TRAN block, then of course that sessions activity is capable of rollback. However, if you FUBAR by the use of TRUNCATE and have a backup.... Is this a trick question?
Jeremy Greaves
Fenris Software Consulting, Inc
MS Sql Server LazyDBA home page