0
CAST / CONVERT Difference IN SQL SERVER
1 Answer
0
Both cast and convert perform data type conversions for us.
They both do the same thing with the exception that convert does some date formatting conversions that cast does not offer.
CAST is ANSI complaint.
CONVERT is not ANSI Complaint.
Syntax:
CAST ( Expression as DATATYPE )
CAST('2014-05-02' AS datetime);
CONVERT ( DATATYPE , Expression , Style )
convert(varchar(16), dateTimeValue, 120)