title: Arithmetic overflow error converting numeric to data type numeric
body: <pre><code>ALTER FUNCTION [dbo].[avgGpa]()
  RETURNS decimal(3,2)
  AS
  BEGIN
      DECLARE @CalcGPA decimal(10,2)
      DECLARE @CalcGPA2 decimal(3,2)
  
      SELECT @CalcGPA = SUM(cast(GPA AS decimal(10,2))) from dbo.Students
      SELECT @CalcGPA2 = cast(ROUND((@CalcGPA / 1000),2) AS decimal(3,2))
  
      RETURN @CalcGPA2
  END
  </code></pre>