• GilaMonster (2/1/2012)


    Question is, how far do you go?

    Just char, varchar, nchar, nvarchar, binary, varbinary?

    Also decimal and numeric (default is numeric(18,0))?

    Also time (default is time(7)), datetime2 (default is datetime2(7)) and datetimeoffset (default is datetimeoffset(7))?

    The new datetime and time default to their highest precision. Numeric and decimal default to something in the middle. The character and binary types default to their minimum when declared.

    I think the default precisions for time, datetime2 and datetimeoffset are sensible, so although I have a general feeling that precision defaults are not a good thing I guess I can live with the defaults for those three.

    Decimal and Numeric have such bizarre rounding and precision/scale adjustment conventions that it seems pure insanity to have defaults for precision and scale, since the effects could be disastrous; so I'd prefer it to be forbidden to omit precision and scale for these types (actually I'd prefer MS to implement the 2008 revision of the floating point standard so that we could have exponents to base 10 and deprecate decimal, numeric, money and smallmoney, but there's no chance of that in the short or medium term, and probably very little chance even in the long term).

    Tom