SELECT
CAST(2.5888712345678923456789 AS TINYINT) AS 'TINYINT'
, CAST(2.5888712345678923456789 AS SMALLINT) AS
'SMALLINT'
, CAST(2.5888712345678923456789 AS INT) AS 'INT'
, CAST(2.5888712345678923456789 AS BIGINT) AS 'BIGINT'
, CAST(2.5888712345678923456789 AS DECIMAL(23,22)) AS
'DECIMAL'
, CAST(2.5888712345678923456789 AS DECIMAL(18,17)) AS
'DECIMAL ROUNDED'
, CAST(2.5888712345678923456789 AS NUMERIC(23,22)) AS
'NUMERIC'
, CAST(2.5888712345678923456789 AS FLOAT(24)) AS
'SINGLE FLOAT'
, CAST(2.5888712345678923456789 AS FLOAT(53)) AS
'DOUBLE FLOAT'
, CAST(2.5888712345678923456789 AS REAL) AS 'REAL'
, CAST(2.5888712345678923456789 AS SMALLMONEY) AS
'SMALLMONEY'
, CAST(2.5888712345678923456789 AS MONEY) AS 'MONEY'
Casting a Number to each data type
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.