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»»»

Implicit Conversions Expand / Collapse
Author
Message
Posted Saturday, May 3, 2008 12:01 PM
SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Friday, May 18, 2007 3:36 PM
Points: 10,039, Visits: 1
Comments posted to this topic are about the item Implicit Conversions
Post #494662
Posted Sunday, May 4, 2008 1:20 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Monday, August 25, 2008 9:56 PM
Points: 843, Visits: 38
Why 3 marks for this question??
Post #494683
Posted Sunday, May 4, 2008 9:30 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 7:27 AM
Points: 35,769, Visits: 32,437
3 Marks isn't bad or good... it means "average" and it is an "Average" question. :P

--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #494699
Posted Sunday, May 4, 2008 9:50 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 5:38 PM
Points: 31,368, Visits: 15,834
I put it as 3 because I think implicit conversions cause a lot of issues, waste time, and I see a lot of questions on these. So it's important.

I may go back and "re-rate" some questions, moving some 1s to 2s and 2s to 3s or 4s, trying to weight them a little more when you have to think. I'll adjust points for correct answers as well if I do.







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #494701
Posted Sunday, May 4, 2008 10:07 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 7:27 AM
Points: 35,769, Visits: 32,437
I agree... judging from some of the "Why am I getting this error" questions on the forum, implicit conversions to "bite" people a lot. This "simple" question is a very good example of a lot of problems folks have with UNIONs and other places where columnar data is mixed to form a single column.

--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #494702
Posted Monday, May 5, 2008 2:04 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Monday, December 15, 2014 4:15 AM
Points: 5,471, Visits: 1,402
Simple but strong question. We require more this type of questions where you have to 'think' before answering.

Before seeing Jeff's comment 'Average Question' :P, I thought it was 'good' question as the marks is '3' not the normal '1'. So I thought more than require.



Post #494814
Posted Monday, May 5, 2008 6:24 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, November 18, 2010 5:25 AM
Points: 162, Visits: 694
Perhaps I missed something...


But I believe this works on SQL2000, but 2005.

There was a change to the behavior of unions....
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/instsql9/html/47edefbd-a09b-4087-937a-453cd5c6e061.htm



Honor Super Omnia-
Jason Miller
Post #494903
Posted Monday, May 5, 2008 6:56 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, August 13, 2013 11:43 AM
Points: 242, Visits: 433
I have 2000, and it gave the "correct" result for me.


Puto me cogitare, ergo puto me esse.
I think that I think, therefore I think that I am.
Post #494918
Posted Monday, May 5, 2008 7:21 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 7:24 AM
Points: 2,565, Visits: 1,394
This does not work on SQL Server 2005. You get the following error message:
"Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the varchar value 'B' to data type int."
Post #494933
Posted Monday, May 5, 2008 8:03 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, March 31, 2011 1:40 AM
Points: 1,938, Visits: 208
That's why I feel answer b is not correct. Answer b says the value is converted to an int. The error message says the conversion failed. So, it appears to be a compilation error.
Post #494985
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse