Data Types (Level 4)
SQL Server 6.x | SQL Server 2000 |
---|---|
The decimal and numeric data types could use anywhere from 2 through 17 bytes to store a value, depending on the precision of the stored value. | numeric and decimal now use 5, 9, 13, or 17 bytes of storage.
Expect different results as compared to earlier versions of Microsoft® SQL Server™. Be sure that databases using the numeric or decimal data types have sufficient storage for the change in storage bytes. |
Results that were too small to display, called floating point underflow, returned inconsistent results for some mathematical operators and functions. | SQL Server now returns 0.0 and no error message for all instances of floating point underflow.
Because of the fixed size of floating point numbers like the float and real data types, approximate numeric data have intrinsic precision and ranges of values. In cases of floating point underflow, a result of 0.0 will be returned and no error message will be displayed. For example, the mathematical calculation of 2 to the -100.0 power would have a result 0.0. Expect different results as compared to earlier versions of SQL Server. Expect different results with floating point underflow with the mathematical functions or operators. For more information, see Using Mathematical Functions. + (Add)
- (Subtract) |
A negative second parameter equal to the number of digits in the ROUND expression returned a value of 0 for integer, float, and money data types. When the second parameter was negative and less than the number of digits in the ROUND expression, ROUND returned a value that rounded the right-most digit down to 0. | When the second parameter in the ROUND function is a negative value (for all numeric data types) that is less than the number of digits in the expression, SQL Server returns a value that is rounded up to the next digit position.
Expect different results with the ROUND function, compared to earlier versions of SQL Server, when the second parameter is negative. |
The DATEADD and DATEDIFF functions returned a date value when adding or subtracting date values. | Direct date value addition and subtraction operations are supported for datetime and smalldatetime using the +(Add) and -(Subtract) operators.
For simple date arithmetic, you can also use addition ( + (Add) ) or subtraction ( - (Subtract)) instead of DATEADD and DATEDIFF. |