T-SQL : Number Types and Function

 USE keyword to ensure that the correct database is been used,







Declare a variable

DECLAR @myvar as int = 2

or 

DECLAR @myvar as int

set @myvar = 2

select @myvar as myvariale

tested below

DECLARE @myvar as int = 2

select @myvar as my_variable;

















int datatype truncates anything that comes after decimal.












Comments

Popular posts from this blog

T-SQL String Data Types and Function

T-SQL - Page 1 : Download and Install & Creating Tables , Retrieving , and deleting