Convert means to change the form or value of something. The CONVERT() function in SQL server is used to convert a value of one type to another type.
Syntax :
SELECT CONVERT
( target_type ( length ), expression )
Parameters used :
- target_type –
- It is the target data type to which the to expression will be converted, e.g: INT, BIT, SQL_VARIANT, etc.
- length –
- It provides the length of the target_type. Length is not mandatory. Default length is set to 30.
- expression –
- expression is anything that will be converted.
#sql #dbms-sql #sql-server