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

concatenation Expand / Collapse
Author
Message
Posted Tuesday, August 21, 2012 6:09 AM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Sunday, June 16, 2013 3:45 AM
Points: 688, Visits: 163
Thanks for the question. I ran in to a similar situation while creating a query last week.
Post #1347739
Posted Tuesday, August 21, 2012 6:31 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Wednesday, May 6, 2015 10:27 AM
Points: 1,561, Visits: 2,641
Nice question, and a nice example showing that data type issues don't always result in an error. Implicit conversion isn't always your friend.

Post #1347744
Posted Tuesday, August 21, 2012 7:02 AM
UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: Today @ 2:38 PM
Points: 1,479, Visits: 1,921
Prassad Dabbada V R (8/21/2012)
I thought it will conevert everything to int. As the expression eveluates from right to left so from the right first plus will return 121 (120 will be converted to int) and so on and so forth.
but unfortunately my guess is wrong.


No, expressions evaluate from left to right.

I got it wrong because I'm so used to shortcutting the addition of 3 numbers in my head that I for some reason thought SQL Server could do the same. Too early in the morning, not enough coffee, {{insert additional generic excuse}}.
Post #1347761
Posted Tuesday, August 21, 2012 7:28 AM


Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Tuesday, March 31, 2015 7:58 AM
Points: 695, Visits: 316
Good question..! I m woundering why almost 50% attempts are wrong.

Best,
Naseer Ahmad
SQL Server DBA
Post #1347785
Posted Tuesday, August 21, 2012 7:30 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 10:35 AM
Points: 1,942, Visits: 7,081
sestell1 (8/21/2012)
Implicit conversion isn't always your friend.


Implicit conversion isn't ever your friend!
Post #1347786
Posted Tuesday, August 21, 2012 7:49 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Friday, May 15, 2015 8:25 AM
Points: 1,529, Visits: 2,756
Nice question . Thanks.


Sujeet Singh
Post #1347798
Posted Tuesday, August 21, 2012 7:57 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Wednesday, May 6, 2015 7:24 PM
Points: 3,808, Visits: 1,250
Nice question, learned something new today. I was quite sure the answer would be 251, but then I remembered data type precedence may be tricky.

Toreador (8/21/2012)
sestell1 (8/21/2012)
Implicit conversion isn't always your friend.


Implicit conversion isn't ever your friend!

Implicit conversion isn't even your friend!


"El" Jerry.

"A watt of Ottawa" - Gerardo Galvan

To better understand your help request, please follow these best practices.
Post #1347804
Posted Tuesday, August 21, 2012 8:43 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 7:52 AM
Points: 1,238, Visits: 1,229
good and easy question, thanks

--------------------------------------
"Stay Hungry, Stay Foolish." ― Jobs
“Everything has beauty, but not everyone sees it.” ― Confucius

Post #1347826
Posted Tuesday, August 21, 2012 8:48 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 8:32 AM
Points: 3,583, Visits: 2,098
Nice question about the basics. Thanks!
Post #1347832
Posted Tuesday, August 21, 2012 8:49 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Monday, November 10, 2014 12:05 PM
Points: 3,969, Visits: 3,648
EL Jerry (8/21/2012)
Nice question, learned something new today. I was quite sure the answer would be 251, but then I remembered data type precedence may be tricky.

Toreador (8/21/2012)
sestell1 (8/21/2012)
Implicit conversion isn't always your friend.


Implicit conversion isn't ever your friend!

Implicit conversion isn't even your friend!

I unfriended Implicit Conversion long ago.
Post #1347835
« Prev Topic | Next Topic »

Add to briefcase ««1234»»»

Permissions Expand / Collapse