Collections:
Overflow Errors on Converting Big Values to NUMERIC in SQL Server
What Happens When Converting Big Values to NUMERIC Data Types in SQL Server Transact-SQL?
✍: FYIcenter.com
If you are converting a numeric expression to a NUMERIC data type and the value is too big for the storage size, you will get an arithmetic overflow error as shown in the following examples:
-- Overflow error on implicit conversion DECLARE @x FLOAT(24); DECLARE @y NUMERIC(5,2); SET @x = 12345.12E+00; SET @y = @x; GO Msg 8115, Level 16, State 6, Line 4 Arithmetic overflow error converting real to data type numeric. -- Overflow error on explicit conversions DECLARE @x FLOAT(24); SET @x = 12345.12E+00; SELECT CAST(@x AS NUMERIC(5,2)); SELECT CONVERT(NUMERIC(5,2),@x); GO Msg 8115, Level 16, State 6, Line 3 Arithmetic overflow error converting real to data type numeric. Msg 8115, Level 16, State 6, Line 4 Arithmetic overflow error converting real to data type numeric.
⇒ Mathematical Functions Supported by SQL Server 2005 in SQL Server
⇐ Overflow Errors on Converting Big Values to Integers in SQL Server
⇑ Numeric Expressions and Functions in SQL Server Transact-SQL
2017-03-22, 1942🔥, 0💬
Popular Posts:
How To Fix the INSERT Command Denied Error in MySQL? The reason for getting the "1142: INSERT comman...
How REAL and FLOAT Literal Values Are Rounded in SQL Server Transact-SQL? By definition, FLOAT(n) sh...
How to execute statements in loops in SQL Server Transact-SQL? How to use WHILE ... loops? You can u...
How To Use DATEADD() Function in SQL Server Transact-SQL? DATEADD() is a very useful function for ma...
Where to find Oracle database server tutorials? Here is a collection of tutorials, tips and FAQs for...