Difference between CONVERT and CAST
Is there any difference between CONVERT and CAST including performance issues?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Amira BedhiafiPosted Apr 19, 2021, 9:47 AM
CONVERT is SQL Server specific,
CASTis ANSI.CONVERT is known as more flexible when it comes to formatting dates for example.
They are pretty much the same.
With CAST, you indicate the expression and the target type; with CONVERT, there’s a third argument representing the style for the conversion, which is supported for some conversions, like between character strings and date and time values.
Which one is faster?
Only the query plan can tell you about it.
But,
You should know that the performance differences between
CASTandCONVERTare negligible.