Recent PostsRecent Posts Popular TopicsPopular Topics
 Home Search Members Calendar Who's On

 Casting question Rate Topic Display Mode Topic Options
Author
 Message
 Posted Friday, March 15, 2013 5:31 AM
 SSCoach Group: General Forum Members Last Login: 2 days ago @ 1:35 AM Points: 15,510, Visits: 13,170
 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 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 Group: General Forum Members Last Login: Monday, September 14, 2015 9:34 PM Points: 429, Visits: 389
 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),'*'),' ','') AS Ret`0That's correct. Convert to varchar to remove the trailing spaces. --------------------------------------------------------------------------------------Hai TonMy Db4Breakfast blog.
Post #1431506
 Posted Friday, March 15, 2013 7:37 AM
 SSCrazy Group: General Forum Members Last Login: Tuesday, December 6, 2016 2:35 PM Points: 2,065, Visits: 3,385
 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 Group: General Forum Members Last Login: Tuesday, January 26, 2016 9:10 AM Points: 2,602, Visits: 1,694
 Good question and thanks! Not all gray hairs are Dinosaurs!
Post #1431609
 Posted Friday, March 15, 2013 10:03 AM
 SSC-Insane Group: General Forum Members Last Login: 2 days ago @ 2:52 PM Points: 20,083, Visits: 18,257
 Thanks - EZPZ Jason AKA CirqueDeSQLeilI have given a name to my pain...MCM SQL Server, MVPSQL RNNRPosting Performance Based Questions - Gail Shaw
Post #1431613
 Posted Friday, March 15, 2013 11:28 AM
 SSCommitted 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 Group: General Forum Members Last Login: Yesterday @ 2:03 PM Points: 9,836, Visits: 11,913
 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
 SSCarpal Tunnel Group: General Forum Members Last Login: Thursday, December 8, 2016 5:39 PM Points: 4,134, Visits: 2,326
 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
 SSCommitted Group: General Forum Members Last Login: Yesterday @ 8:17 PM Points: 1,622, Visits: 1,740
 Nice question, make us thinking. --------------------------------------“Everything has beauty, but not everyone sees it.” ― Confucius
Post #1431822

 Permissions