Declare @T Table (iDay VARCHAR(4),iNum DECIMAL(18,2),yuxiang DECIMAL(18,9)) Insert @T --EXEC [dbo].[BSP0101_GetYuXiang] -- @YearMonth = N'201801', -- @Type = N'工具费', -- @Department = N'01010102', -- @EngineType = N'ZR' EXEC [dbo].[BSP0101_GetYuXiang] @YearMonth = @vcYearMonth, @Type = @FMName, @Department = @LineCode, @EngineType =@Engine DECLARE @RiBiesum DECIMAL(18,2) Select @RiBiesum=ROUND(SUM(yuxiang),2) from @T PRINT @RiBiesum