cast vs convert

how do i decide which to use: cast() or convert() in t-SQL
vinny45Asked:
Who is Participating?
 
arbertConnect With a Mentor Commented:
Straight from books online:

"CAST is based on the SQL-92 standard and is preferred over CONVERT."
0
 
jdlambert1Connect With a Mentor Commented:
You didn't find that clearly documented?? Neither did I. :)

I use Cast unless I need the extra "style" argument of Convert, but if you don't need the optional style, it makes no difference in performance or results.
0
 
jdlambert1Commented:
Ah, yes, the old "Look under 'Data Type Conversion' instead of Cast or Convert" trick.  Thanks, Brett!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.