Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


cast, convert and float!


cast, convert and float!

Author
Message
chriscoates
chriscoates
Old Hand
Old Hand (308 reputation)Old Hand (308 reputation)Old Hand (308 reputation)Old Hand (308 reputation)Old Hand (308 reputation)Old Hand (308 reputation)Old Hand (308 reputation)Old Hand (308 reputation)

Group: General Forum Members
Points: 308 Visits: 110
Chris Harshman (8/20/2009)
I think the 30% of us (me included) that got it wrong just need to make sure we get our morning caffiene before trying to answer the questions ;-)


Yep - add me to that 30% (31%now). Spent too long working out what 21 *0.5 was to remember to check the @c assignment afterwards! Easy point thrown away there! Coffee please. Black. Strong!
Michael Poppers
Michael Poppers
Right there with Babe
Right there with Babe (761 reputation)Right there with Babe (761 reputation)Right there with Babe (761 reputation)Right there with Babe (761 reputation)Right there with Babe (761 reputation)Right there with Babe (761 reputation)Right there with Babe (761 reputation)Right there with Babe (761 reputation)

Group: General Forum Members
Points: 761 Visits: 416
webrunner (8/20/2009)
I just plain got it wrong because of the int @c, after focusing too much on confirming the 21 * 0.5 calculation. Good question in that it highlights rookie mistakes I shouldn't be making....

Ditto :-). FWIW, though, I would never name an @int variable "c" (or "d")!
TomThomson
TomThomson
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10765 Visits: 12019
JacekO (8/20/2009)
Scary part is over 30% (at the time of this post) got it wrong. Many QoDs are quite tricky but this one is very basic and really not SQL specific (data type conversion or casting is an ABC of any programming language).
Looks like a concept of code review or inspection is missing way too often...

For me the really scary part is that I agree wth JacekO's comment and I got it wrong! Maybe senile dementia is setting in!!!

Tom

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search