How to regain space after dropping columns in SQL Server

I hit an annoying issue today. I wanted to regain space after I dropped several columns in a table. When I run the famous query from StackOverflow:

I got a set of numbers which were the same before and after the removal has

There is, however, a potential issue with this approach if you are working in an active database. The query seems to block any other queries.