The parameter @CCICandidateMinSizeGB, based on its name, is in GB.
When it's used within the WHERE expression, it's divided by 1024 when compared against a value in MB:
tos.table_size_mb > @CCICandidateMinSizeGB / 1024. -- consider sufficiently large tables only
However, dividing a number that represents GB by 1024 would represent TB, not MB.
In order to be represented in MB, it needs to be MULTIPLIED by 1024. Not divided by 1024.
Like this:
tos.table_size_mb > @CCICandidateMinSizeGB * 1024. -- consider sufficiently large tables only
The parameter
@CCICandidateMinSizeGB
, based on its name, is in GB. When it's used within the WHERE expression, it's divided by 1024 when compared against a value in MB:However, dividing a number that represents GB by 1024 would represent TB, not MB. In order to be represented in MB, it needs to be MULTIPLIED by 1024. Not divided by 1024.
Like this:
https://github.com/microsoft/azure-sql-tips/blob/main/sqldb-tips/get-sqldb-tips.sql#L3431