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: Yesterday @ 10:26 AM
Points: 13,359, Visits: 10,223
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: Friday, July 18, 2014 12:55 AM
Points: 386, Visits: 363
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: Yesterday @ 10:33 AM
Points: 1,282, Visits: 2,219
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: Yesterday @ 9:42 AM
Points: 2,269, Visits: 1,327
Good question and thanks!

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


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 9:07 PM
Points: 21,351, Visits: 15,032
Thanks - EZPZ



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


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1431613
Posted Friday, March 15, 2013 11:28 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, May 28, 2014 1:04 PM
Points: 1,364, Visits: 1,055
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 @ 5:31 PM
Points: 8,577, Visits: 9,090
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: 2 days ago @ 10:45 AM
Points: 3,266, Visits: 1,959
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: Monday, July 28, 2014 11:47 AM
Points: 1,019, Visits: 1,003
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