|
What is the difference between CAST and CONVERT in SQL?
|
|
Both CAST and CONVERT perform datatye conversions. In most respects, they both do the same thing, with the exception that CONVERT also does some date formatting conversions that CAST doesn't offer.
|
|
Note:- If CONVERT does everything that CAST does, and CONVERT also does date conversions, then why would ever use CAST? Simple answer for that - ANSI compliance. CAST is ASNI-compliant, and CONVERT isn't.
|
|
|
|
|
|