
In many blogs or forums, you can read that the answer is to use the option: WITH ESTIMATEONLY. With this option, you can easily have the space estimation needed to check the database in tempdb. But be careful, only since SQL Server 2014, this estimation has been good! See the PS from Paul Randal’s blog for this information, here But between SQL server 2008, 2012 and 2014…and 2016, the result of this query changed! 😕