The 1.round () function is rounded with, the first parameter is the data we want to manipulate, the second parameter is set after we rounded the decimal point after a few shows.
The 2 parameters of the 2.numeric function, the first representing the length of the data, and the second parameter represents the number of digits after the decimal point.
For example:
Select CAST (Round (12.5,2) as numeric (5,2)) Results: 12.50
Select CAST (Round (12.555,2) as numeric (5,2)) Results: 12.56
Select CAST (Round (122.5255,2) as numeric (5,2)) Results: 122.53
Select CAST (Round (1222.5255,2) as numeric (5,2)) Result: Error! The reason is: 1222.5255, the integer digit is 4, the decimal place is 2, add up 4+2=6, exceed the numeric set 5 bits, so in order to insure, can increase or decrease the numeric parameter, for example numeric (20,2).
This article is reproduced after making an adjustment, reprinted from: http://blog.csdn.net/caoyuanlang_11/article/details/5410833
SQL Server rounding, 2 digits after decimal point