ia01
12 years agoLevel 6
Arithmetic overflow error converting expression to data type int
Hi,
Just trying to run the following query, it was working for a while, suddenly started getting "Msg 8115, Level 16, State 2, Line 1
Arithmetic overflow error converting expression to data type int." Any suggestion please?
select COUNT(*), SUM(SS.ItemSize)/1024 'size in MB' from saveset SS
inner join ArchivePoint AP on SS.ArchivePointIdentity = AP.Archivepointidentity
inner join gsgs2evfsql01.EnterpriseVaultDirectory.dbo.ArchiveView EVDAV on AP.ArchivePointId = EVDAV.VaultEntryId
where EVDAV.ArchiveName = 'archive'
and SS.ArchivedDate > '2010-10-12'
and SS.ArchivedDate < '2012-12-12'
Many Thanks
You're going to have to CAST the item to a bigger int
SUM(CONVERT(bigint,SS.ItemSize))