Open Hedrik opened 6 months ago
Same, the overflow happens when aggregating the record_count
on lines 424 - 423:
SUM(ISNULL(ps.record_count,0)),
SUM(ISNULL(ps.forwarded_record_count,0)) -- for heaps
Solution: change the datatype of the temp table to bigint
(lines 86 - 96):
CREATE TABLE #tmpIPS (
[database_id] int,
[object_id] int,
[index_id] int,
[partition_number] int,
fragmentation DECIMAL(18,3),
[page_count] bigint,
[size_MB] DECIMAL(26,3),
record_count **bigint**,
forwarded_record_count **bigint** NULL,
CONSTRAINT PK_IPS PRIMARY KEY CLUSTERED(database_id, [object_id], [index_id], [partition_number]))
Freshly downloaded from GitHub. No usage instructions found, so I just added a 'USE {Db}' at the top and ran it. Here is the relevant part of the message output - I suspect that the script may need to be updated to use the bigint type instead of int - I will report back if I attempt again after changing to bigint, though given that it took 6 and 1/2 hours to run, I may just wait on that...: (then again, I don't see anything even possible in the region of the line reported as having the error, so...)
And the result had no data: