T-SQL Tutorial

Float - TSQL Tutorial


On Transact SQL language the float is an numeric data type and defines approximate numeric values.

Float syntax:

float

Float example:

USE model;
GO
DECLARE @myVar1 float;
DECLARE @myVar2 float;
DECLARE @myVar3 float;
SET @myVar1 = 215;
SET @myVar2 = 215.5;
SET @myVar3 = -215.7;
PRINT @myVar1;
PRINT @myVar2;
PRINT @myVar3;
GO

Results
215
215.5
-215.7