Caste and Convert Functions:

These functions are useful for converting one datatype to another datatype. Syntax: -> cast(expression as data type[(lenght}] -> convert(targetdata type[(lenght)],expression[style])

Difference between cast and convert functions:

-> Cast is ANSI standard and Convert is specific in SQL server. -> Cast can't be used for formatting purpose whereas convert can be used for formatting purpose particularly on datetime and money data type.

Converting integer into varchar type:

declare @i int, set @i=100, select cast (@i as variable(20)) as 'varcharvalue' Note: In general we will never use money data type, in realtime application development instead we use varchar data type.