Explicitly converts an expression of one data type to another. CAST and CONVERT provide similar functionality.
Syntax
Using CAST:
CAST(expression AS data_type)
Using CONVERT:
CONVERT (data_type[(length)], expression [, style])
Arguments
expression
Is any valid Microsoft® SQL Server™ expression. For more information, see Expressions.
data_type
Is the target system-supplied data type. User-defined data types cannot be used. For more information about available data [...]
Filed under: Sqlserver | 2 Comments »