Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««123

Coalesce and Conversion Expand / Collapse
Author
Message
Posted Wednesday, January 9, 2013 6:51 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Monday, September 15, 2014 11:49 AM
Points: 1,848, Visits: 587
Great QoTD..
Thanks..
Post #1405114
Posted Thursday, January 10, 2013 10:47 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 6:01 PM
Points: 7,689, Visits: 9,415
john.arnott (1/8/2013)
How annoying. You made me think! ;)

I agree this was an excellent question and explanation. I do see that one minor correction could be needed to one example given, however. You say "...for example the numeric value 37.2 can be converted to an int (37)...". Did you actually mean that an INT (@i) could be converted to the higher precedence numeric type, as obviously could be the literal value 37.2? After all, the result of that coalesce is 37.2 and not 37.

yes, I did. Obviously my check-reading what I had written wasn't up to scratch that day.
edit: On second thoughts no; what I really meant was that no conversion was required because the decimal value 37.2 already has the type (decimal) with highest precedence of the three parameters to that coalesce expression.


Tom
Post #1405559
Posted Friday, January 11, 2013 11:53 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, September 16, 2014 8:11 AM
Points: 270, Visits: 236
really very tough one...

Manik
You cannot get to the top by sitting on your bottom.
Post #1406213
Posted Saturday, February 2, 2013 3:20 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, July 16, 2014 6:22 AM
Points: 271, Visits: 96
I got the result by executing the each statement :)
Post #1414933
Posted Thursday, August 21, 2014 3:23 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Thursday, September 18, 2014 8:39 AM
Points: 2,935, Visits: 239
Thanks, an interesting question. I don't use that much though.
Post #1606044
« Prev Topic | Next Topic »

Add to briefcase «««123

Permissions Expand / Collapse