|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 5:55 AM
Points: 5,101,
Visits: 20,197
|
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Today @ 12:22 AM
Points: 1,112,
Visits: 969
|
|
| Good Question. Back to the basics. +1 to the total.
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 1:26 AM
Points: 226,
Visits: 230
|
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 2:10 AM
Points: 1,234,
Visits: 346
|
|
| Very interesting question. Learnt something new again.
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 6:17 AM
Points: 219,
Visits: 191
|
|
The explanation I see is that on answers 1,3,4,5,6 implicit data types conversion happens because of mixing INT and CHAR types.
On the answer 2, we just try to multiply 2 CHAR, therefore an error is raised up.
Good question!
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: Thursday, May 02, 2013 2:00 AM
Points: 503,
Visits: 66
|
|
raulggonzalez (2/29/2012) The explanation I see is that on answers 1,3,4,5,6 implicit data types conversion happens because of mixing INT and CHAR types.
On the answer 2, we just try to multiply 2 CHAR, therefore an error is raised up.
Good question!Yeah, I have to agree, multiplying strings is the cause. It errors before it even tries to implicitly cast the answer to an int.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Today @ 7:22 AM
Points: 1,400,
Visits: 6,888
|
|
I particularly like the fact that a QOTD was verified by several people before publication.
BrainDonor Linkedin
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Today @ 4:10 AM
Points: 444,
Visits: 1,195
|
|
It gives me this error on the 2nd block
Msg 8117, Level 16, State 1, Line 3 Operand data type char is invalid for multiply operator.
I guess E stands for ERROR?
ww; Raghu -- There are only 10 types of people in the world, those who understand binary, and those who don't.
Note: (as of now) only.. 1 and 4 applies (i am on my way...)
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 2:04 AM
Points: 1,968,
Visits: 1,819
|
|
This kind of error also is independent from version of sqlserver. You can not use - * / operators with chars
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 9:52 AM
Points: 1,356,
Visits: 4,761
|
|
| Yet another question that tells us not to rely on implicit conversion...
|
|
|
|