From the above statement from MSDN, if we use TABLOCK in the DELETE statement then the allocated pages will be deallocated.
I have checked whether there is any available space/allocated for the table, by using sp_Spaceused it is showing the allocated pages as it is. So the above statement is not true, right? But it is from MSDN so we can't tell this is wrong statement.
For the TRUNCATE TABLE statement, it is deallocating the pages.
If the table is heap ( i.e. it does not have clustered index) & you use TABLOCK when deleting, the pages will be deallocated. It can be shown using undocumented command DBCC IND:
IF OBJECT_ID('TheTable') IS NOT NULL
DROP TABLE TheTable;
CREATE TABLE TheTable
ID INT IDENTITY(1,1),
INSERT INTO TheTable (Data) VALUES (REPLICATE('SomeData',150))
--Check the number of pages allocated to the table
DBCC IND ('AdventureWorks','TheTable',-1) -- 175 pages
DELETE FROM TheTable WITH (TABLOCK)
DBCC IND ('AdventureWorks','TheTable',-1) -- Only 1 page (IAM page) available & all other pages deallocated
--after deleting with TABLOCK
In the above example if you delete the data without using TABLOCK the pages will not be deallocated (that also can be checked using the same DBCC IND).