Exact Numbers : decimal « Data Types « SQL Server / T-SQL Tutorial






6> Create table Patient (PatientId int,
7>      FullName varchar(20),
8>      Weight decimal(5,2),
9>      Height decimal(5,2),
10>      ADP smallint,
11>      BDZ tinyint)
12> go
1>
2> --decimal constants do not need delimiters either:
3>
4> insert into Patient (PatientId, FullName, Weight, Height, ADP, BDZ)
5> values (834021, 'Tom Jones', 89.5, 188.5, 450, 11)
6> GO

(1 rows affected)
1>
2> select * from Patient;
3> GO
PatientId   FullName             Weight  Height  ADP    BDZ
----------- -------------------- ------- ------- ------ ---
     834021 Tom Jones              89.50  188.50    450  11

(1 rows affected)
1>
2> drop table Patient;
3> GO
1>








5.10.decimal
5.10.1.Exact Numbers
5.10.2.Convert DECIMAL(10,2) to varchar(10)
5.10.3.Use like to check DECIMAL after converting
5.10.4.CAST(BillingTotal AS dec(12,2))