April 18, 2011 at 9:48 am
Missed it. Good reminder to specify precision.
April 18, 2011 at 11:09 am
Nice question thanks! I wish SQL Server had an option to require that all variable declarations include the size parameters.
April 18, 2011 at 11:44 am
Thanks for the question! We should make a rule that all Monday QOTD have to be "back to basics" type of questions, mirroring the The New York Times crossword puzzle which is always easy on Mondays.
April 18, 2011 at 11:45 am
A mental point to myself for thinking about the answer and then executing it 😀 It's almost like not cheating!
______________________________________________________________________________
How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.
April 18, 2011 at 12:41 pm
Good question.
April 18, 2011 at 2:36 pm
I remember my first experience with datatypes, like;
DECLARE @1value int
DECLARE @2value int
SET @1value = 3
SET @2value = 2
SELECT @1value / @2value
April 18, 2011 at 7:09 pm
Got it wrong :doze:
I tought the default scale on decimal would be 2
Should have take time to verify...
Good question, Thanks!
April 18, 2011 at 11:23 pm
Nice question.
-----------------
Gobikannan
April 19, 2011 at 5:11 am
pdooley-1104895 (4/18/2011)
I wish you would have asked about a SET @dvalue = 10.12Even though I got the answer correct the 10.10 clouds weather the (10) or the (.10) is the number being stored.
good question! Peace
Since the data type is DECIMAL with no scale (= how many positions to the right of the decimal indicator), it's the integer part (10) that get's stored. Or in other words--truncation will never occur on the integer part of a decimal...
Hope this helps.
Regards,
Michael
April 19, 2011 at 7:32 am
i got 94.3400
Viewing 10 posts - 16 through 24 (of 24 total)
You must be logged in to reply to this topic. Login to reply