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

Session : 2 : Creating and querying part of a table