Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why would you use cast over convert?

Status
Not open for further replies.
Mar 29, 2010
20
GB
When and why would you ever use 'cast' over 'convert'?

I presume there is a slight difference in speed as cast doesn't do quite as much as convert, but surely the difference would be so small that it is insignificant.

Would you only use cast to make scripts more portable for other SQL environments like Oracle, or does cast have a technical advantage over convert in some situation that im unaware of?
 
generally, I only ever use convert if I actually need the result to be formatted in a particular way and the datatype is datetime... the main reason being, cast is quicker to type and has less arguments...

--------------------
Procrastinate Now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top