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 @ 1:40 AM
Points: 14,513, Visits: 12,558
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 SQLKover.

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


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Tuesday, July 21, 2015 10:18 PM
Points: 426, Visits: 383
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


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 2:26 PM
Points: 1,622, Visits: 2,734
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, July 24, 2015 4:49 PM
Points: 2,588, Visits: 1,683
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: Yesterday @ 10:47 PM
Points: 18,940, Visits: 17,222
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


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Friday, December 19, 2014 8:20 AM
Points: 1,520, Visits: 1,060
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


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Yesterday @ 4:20 PM
Points: 8,671, Visits: 10,476
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: Thursday, July 16, 2015 3:38 PM
Points: 3,659, Visits: 2,136
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: Yesterday @ 8:53 AM
Points: 1,282, Visits: 1,309
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