• prudhviraj.sql (1/4/2012)


    @Paul

    I need a clarification here.

    Microsoft article states that the minimum scale of a decimal can be 0.

    http://msdn.microsoft.com/en-us/library/ms187746.aspx

    So I don't get the point where the minimum scale is defined as 6

    6 isn't the minimum scale of a numeric type, it is the minimum scale of the type of a numeric value which is the direct result of the multiplication of two numeric values whose scales add up to 6 or more. Of course if the result is placed immediately into a variable or a column with a predefined type you never see the type of the direct result. It's also the minimum scale of the type of a numeric which is the direct result of a division where the precision of the divisor plus the scale of the dividend is greater than 4 and also of the type of teh direct result of an addition or subtraction or modulus where either of the two scales of the things being added/subtracted/remaindered is greater than 5.

    See http://msdn.microsoft.com/en-us/library/ms190476.aspx

    Tom