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

Casting question Expand / Collapse
Author
Message
Posted Friday, March 15, 2013 5:31 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 7:44 AM
Points: 13,562, Visits: 11,372
Thanks for the question!



How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1431469
Posted Friday, March 15, 2013 5:43 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: Thursday, June 12, 2014 4:19 AM
Points: 701, Visits: 1,145
Thanks for the question. Great Friday question to end the week!
Post #1431478
Posted Friday, March 15, 2013 6:38 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Wednesday, November 19, 2014 10:38 AM
Points: 386, Visits: 366
Christian Buettner-167247 (3/15/2013)
Good question but the correct answer is "0 " (with 2 trailing spaces), not "0".#

Edit: Add example:
SELECT REPLACE(ISNULL ( CONVERT (char(3),1/9),'*'),' ','<Space>') AS Ret

0<Space><Space>


That's correct. Convert to varchar to remove the trailing spaces.


--------------------------------------------------------------------------------------
Hai Ton
My Db4Breakfast blog.
Post #1431506
Posted Friday, March 15, 2013 7:37 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 9:22 AM
Points: 1,395, Visits: 2,418
okbangas (3/15/2013)
Really easy question, but the explanation puzzles me. As far as I can see it is no implicit conversion, just a pure integer division.


I assume it is a reference to the 1 and the 9 being interpreted as integers.
Post #1431533
Posted Friday, March 15, 2013 9:50 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Friday, November 21, 2014 10:15 AM
Points: 2,464, Visits: 1,551
Good question and thanks!

Not all gray hairs are Dinosaurs!
Post #1431609
Posted Friday, March 15, 2013 10:03 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 9:21 AM
Points: 17,977, Visits: 15,981
Thanks - EZPZ



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Post #1431613
Posted Friday, March 15, 2013 11:28 AM


UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: Friday, September 19, 2014 7:15 AM
Points: 1,447, Visits: 1,059
I guess I'm the only one that initially looked for '1/9' as an answer choice. Doh.
Post #1431653
Posted Friday, March 15, 2013 11:41 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 2:25 PM
Points: 7,868, Visits: 9,607
Nice question, but it's a pity that the correct answer isn't any of the options. I picked '0' as it's the least wrong, but it definitely is wrong. The correct answer is '0 ' (two trailing spaces) and '0' isn't even a possible value for a char(3) object.

Tom
Post #1431657
Posted Friday, March 15, 2013 2:53 PM


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: Yesterday @ 12:42 PM
Points: 3,388, Visits: 2,021
Technically the answer is '0 ', but it was easy enough to deduce the answer choice that the author was looking for. If "None of the above" had been a choice then I imagine the comments on this thread would be much more "spirited".

Good question overall. Thanks Eli!
Post #1431765
Posted Friday, March 15, 2013 4:03 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, November 21, 2014 11:01 AM
Points: 1,113, Visits: 1,089
Nice question, make us thinking.

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

Post #1431822
« Prev Topic | Next Topic »

Add to briefcase «««1234»»

Permissions Expand / Collapse