I got this error : 2017/04/10 16:34:12.198 PSYRFPIMA05_AseDbSpce - Error in loop. Error=247 SQL message=Arithmetic overflow during implicit conversion of UNSIGNED INT NULL value '3747070464' to a INT field .
state=ZZZZZ
found the issue is related to "AseDbSpce_V157.xml" and "AseDbSpce_V157SP100.xml" and in AseDbSpce_V16.xml.
issue fixed by adding "convert(bigint,Total_pgs) as Total_pgs" in the below Statement:
"
.
.
.
from (
select dbid, convert(bigint,Total_pgs) as Total_pgs, dbFree_pgs, isMixedLog=0, logTotal_pgs=0, logUsed_pgs=0, logFree_pgs=0, logClr_pgs=0, logsegFree_pgs=0
from #dbinfo
union all
.
.
."
Thanks,
Nischal.
Anonymous
Ok thanks,
I prefer changing the datatype from the beginning of the sql batch :
select U.dbid, Total_pgs=convert(bigint,sum(size)),dbFree_pgs= sum(convert( bigint, case when segmap=4 then 0 else curunreservedpgs(D.dbid, lstart, unreservedpgs) end))
into #dbinfo
from master..sysusages U readpast, master..sysdatabases D
where D.dbid=U.dbid
...
Tell me if it works also for you
Best regards
Jpm
I made the changes as per your suggestion, and it is working fine.
thanks,
Nischal.
Ok good, thank you