﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by Tom Thomson  / Coalesce and Conversion / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 22 May 2013 05:01:39 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Coalesce and Conversion</title><link>http://www.sqlservercentral.com/Forums/Topic1403953-2681-1.aspx</link><description>I got the result by executing the each statement :)</description><pubDate>Sat, 02 Feb 2013 03:20:32 GMT</pubDate><dc:creator>udayroy15</dc:creator></item><item><title>RE: Coalesce and Conversion</title><link>http://www.sqlservercentral.com/Forums/Topic1403953-2681-1.aspx</link><description>really very tough one...</description><pubDate>Fri, 11 Jan 2013 11:53:48 GMT</pubDate><dc:creator>manik123</dc:creator></item><item><title>RE: Coalesce and Conversion</title><link>http://www.sqlservercentral.com/Forums/Topic1403953-2681-1.aspx</link><description>[quote][b]john.arnott (1/8/2013)[/b][hr]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.[/quote]yes, I did.  Obviously my check-reading what I had written wasn't up to scratch that day.  :blush:</description><pubDate>Thu, 10 Jan 2013 10:47:35 GMT</pubDate><dc:creator>L' Eomot Inversé</dc:creator></item><item><title>RE: Coalesce and Conversion</title><link>http://www.sqlservercentral.com/Forums/Topic1403953-2681-1.aspx</link><description>Great QoTD..Thanks..</description><pubDate>Wed, 09 Jan 2013 18:51:52 GMT</pubDate><dc:creator>pchirags</dc:creator></item><item><title>RE: Coalesce and Conversion</title><link>http://www.sqlservercentral.com/Forums/Topic1403953-2681-1.aspx</link><description>Thanks for the great question Tom. It really made me think; there were so many choices and it was so early in the morning. I can definitely say I'm awake now. :-D</description><pubDate>Wed, 09 Jan 2013 07:35:00 GMT</pubDate><dc:creator>Dana Medley</dc:creator></item><item><title>RE: Coalesce and Conversion</title><link>http://www.sqlservercentral.com/Forums/Topic1403953-2681-1.aspx</link><description>Interesting question, thank you Tom.(even kind of knowing the output for each select statement, it tempted me to challenge self and to prove it)</description><pubDate>Wed, 09 Jan 2013 07:03:03 GMT</pubDate><dc:creator>Raghavendra Mudugal</dc:creator></item><item><title>RE: Coalesce and Conversion</title><link>http://www.sqlservercentral.com/Forums/Topic1403953-2681-1.aspx</link><description>Great question, must say. +1</description><pubDate>Wed, 09 Jan 2013 00:01:12 GMT</pubDate><dc:creator>sqlnaive</dc:creator></item><item><title>RE: Coalesce and Conversion</title><link>http://www.sqlservercentral.com/Forums/Topic1403953-2681-1.aspx</link><description>thanks good and very tough question!</description><pubDate>Tue, 08 Jan 2013 22:20:29 GMT</pubDate><dc:creator>jvac</dc:creator></item><item><title>RE: Coalesce and Conversion</title><link>http://www.sqlservercentral.com/Forums/Topic1403953-2681-1.aspx</link><description>Very nice question Tom. Learnt something new today:-)</description><pubDate>Tue, 08 Jan 2013 22:07:41 GMT</pubDate><dc:creator>Lokesh Vij</dc:creator></item><item><title>RE: Coalesce and Conversion</title><link>http://www.sqlservercentral.com/Forums/Topic1403953-2681-1.aspx</link><description>A really good QotD. Thanks, Tom!</description><pubDate>Tue, 08 Jan 2013 12:07:57 GMT</pubDate><dc:creator>Revenant</dc:creator></item><item><title>RE: Coalesce and Conversion</title><link>http://www.sqlservercentral.com/Forums/Topic1403953-2681-1.aspx</link><description>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.</description><pubDate>Tue, 08 Jan 2013 10:32:57 GMT</pubDate><dc:creator>john.arnott</dc:creator></item><item><title>RE: Coalesce and Conversion</title><link>http://www.sqlservercentral.com/Forums/Topic1403953-2681-1.aspx</link><description>Excellent question, and great explanation! Thanks!</description><pubDate>Tue, 08 Jan 2013 09:14:16 GMT</pubDate><dc:creator>Rob Schripsema</dc:creator></item><item><title>RE: Coalesce and Conversion</title><link>http://www.sqlservercentral.com/Forums/Topic1403953-2681-1.aspx</link><description>Tripped myself on this one.Thanks Tom, learned something today, so I guess that makes it worthwhile</description><pubDate>Tue, 08 Jan 2013 08:25:41 GMT</pubDate><dc:creator>Stewart "Arturius" Campbell</dc:creator></item><item><title>RE: Coalesce and Conversion</title><link>http://www.sqlservercentral.com/Forums/Topic1403953-2681-1.aspx</link><description>Good question Tom. Good to have a refresher on these things from time to time.</description><pubDate>Tue, 08 Jan 2013 07:20:12 GMT</pubDate><dc:creator>Sean Lange</dc:creator></item><item><title>RE: Coalesce and Conversion</title><link>http://www.sqlservercentral.com/Forums/Topic1403953-2681-1.aspx</link><description>[quote][b]Koen Verbeeck (1/8/2013)[/b][hr]Great and very interesting question. Thanks Tom![/quote]+1 I must agree... was a lot of fun to sit there pondering if all of the various data types would be compatible with each other.  Now where did I put that Ibuprofen?  heh</description><pubDate>Tue, 08 Jan 2013 06:55:01 GMT</pubDate><dc:creator>mtassin</dc:creator></item><item><title>RE: Coalesce and Conversion</title><link>http://www.sqlservercentral.com/Forums/Topic1403953-2681-1.aspx</link><description>Well, the question is a good one, and I got it right, but if I see code like that I reach for the shot gun.</description><pubDate>Tue, 08 Jan 2013 04:57:31 GMT</pubDate><dc:creator>Rune Bivrin</dc:creator></item><item><title>RE: Coalesce and Conversion</title><link>http://www.sqlservercentral.com/Forums/Topic1403953-2681-1.aspx</link><description>Thanks for the great question!  A true learning question with no controversy.</description><pubDate>Tue, 08 Jan 2013 04:12:45 GMT</pubDate><dc:creator>(Bob Brown)  </dc:creator></item><item><title>RE: Coalesce and Conversion</title><link>http://www.sqlservercentral.com/Forums/Topic1403953-2681-1.aspx</link><description>I prefer ISNULL, the cast is done to the first argument.I use it e.g. with numeric type ISNULL(int_null,0). But, I should remember that with string ISNULL may be dangerous as in this case:declare @c varchar(1) select ISNULL(@c,'N/D')Result:N instead of N/D</description><pubDate>Tue, 08 Jan 2013 01:39:11 GMT</pubDate><dc:creator>Carlo Romagnano</dc:creator></item><item><title>RE: Coalesce and Conversion</title><link>http://www.sqlservercentral.com/Forums/Topic1403953-2681-1.aspx</link><description>Great and very interesting question. Thanks Tom!</description><pubDate>Tue, 08 Jan 2013 00:31:29 GMT</pubDate><dc:creator>Koen Verbeeck</dc:creator></item><item><title>RE: Coalesce and Conversion</title><link>http://www.sqlservercentral.com/Forums/Topic1403953-2681-1.aspx</link><description>still now i thought COALESCE will return the datatype of Non NUll value. Today only i learnt it will consider the highest percedence..Thanks to author for posting nice qstn..</description><pubDate>Tue, 08 Jan 2013 00:13:25 GMT</pubDate><dc:creator>Dineshbabu</dc:creator></item><item><title>RE: Coalesce and Conversion</title><link>http://www.sqlservercentral.com/Forums/Topic1403953-2681-1.aspx</link><description>Nice Question. Learnt something for today.</description><pubDate>Mon, 07 Jan 2013 22:34:21 GMT</pubDate><dc:creator>rals</dc:creator></item><item><title>RE: Coalesce and Conversion</title><link>http://www.sqlservercentral.com/Forums/Topic1403953-2681-1.aspx</link><description>Thanks for the question.</description><pubDate>Mon, 07 Jan 2013 22:07:18 GMT</pubDate><dc:creator>SQLRNNR</dc:creator></item><item><title>RE: Coalesce and Conversion</title><link>http://www.sqlservercentral.com/Forums/Topic1403953-2681-1.aspx</link><description>I missed it completely  :(. no regret , learned something .Also, I am glad to see that on aswering the question, equation for right and wrong is 0% and 100 % Thanks for the question ..</description><pubDate>Mon, 07 Jan 2013 21:12:04 GMT</pubDate><dc:creator>demonfox</dc:creator></item><item><title>Coalesce and Conversion</title><link>http://www.sqlservercentral.com/Forums/Topic1403953-2681-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/questions/T-SQL/95543/"&gt;Coalesce and Conversion&lt;/A&gt;[/B]</description><pubDate>Mon, 07 Jan 2013 21:07:07 GMT</pubDate><dc:creator>L' Eomot Inversé</dc:creator></item></channel></rss>