November 25, 2012 at 6:50 pm
November 25, 2012 at 7:05 pm
thank you , i was trying to use cast but that did not working , thanks again
November 25, 2012 at 7:08 pm
This was my first answered question so thank you 😀
November 26, 2012 at 3:18 am
CELKO (11/25/2012)
...CAST(@abc AS VARCHAR(10)) should work and it much preferred over the old 1970's Sybase CONVERT string function...
CAST and CONVERT are similar but not the same. CAST in T-SQL offers limited (basic) data conversion functionality. I cannot see why someone would prefer one over another... It's not matter of preference, it is matter of suitability. Where CAST functionality is sufficient, you use CAST, where it's not enough (requires specific format key/switch) - use CONVERT.
For example, (especially for standards-loving J.C.) using CAST you can not explicitly convert DATETIME into string in ISO format...
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply