Problem easy to reproduce
declare @SumField7 decimal(5,2) = 123.45 raiserror ('...%d...', 16, 1, @SumField7)
You specify %d as the Type specification, which represents a signed integer , but passing decimal to it. Perhaps this has never been type checked in SQL Server 2000.
There seems to be no syntax for decimal holders, and you will need to pass a string as shown below.
declare @SumField7 decimal(5,2) = 123.45 declare @SumField7String varchar(7) = @SumField7 raiserror ('...%s...', 16, 1, @SumField7String)
source share