I have installed SQL Server 2017. I have created a test_db of size 512 mb and am trying to shrink the database using SQL query:
dbcc shrinkfile(N'test_db', truncateonly)
But i do not see the the database being shrinked. In case i use the following SQL query:
dbcc shrinkfile(N'test_db', 1)
the file gets shrinked to 3mb.
Could you please explain the difference in the behavior? Since TRUNCATEONLY releases empty spaces at the end of the file, why is it not able to shrink the file when the data file is empty.