TAJUZZAMAN

Experienced Senior Software Engineer with a demonstrated history of working in the information technology and services industry. Skilled in .Net Software Development, MSSQL, Oracle Database, C#, PHP, Google Cloud Platform and Microsoft Azure. Strong engineering professional with a Bachelor’s Degree focused in Artificial Intelligence from Universiti Teknologi MARA Malaysia. Currently work as Lead Solution Architect and Director of new startup IT company named Aurora Cloud Works Sdn. Bhd.

  • Home
  • /
  • Database
  • /
  • MSSQL : Checking the number is Integer or Float value

MSSQL : Checking the number is Integer or Float value

Today i am writing new logic to batch insert Staff Leave record since MCO is practice for all my customer.
On a few scenario, i need to find out who has the 0.5 balance in their entitlement balance.
So here i give you the simple code to determine whether the number is Integer or Decimal.

DECLARE @value DECIMAL(10,2) = 7.0
IF FLOOR(@value) <> CEILING(@value)
BEGIN
    PRINT 'Decimal Number'
END
ELSE
BEGIN
    PRINT 'Integer Number'
END
GO