• Edit: Items in bold

    There seems to be some confusion around what is happening here (or I misread some of the comments and the QotD answer?).

    The data types of the columns are determined by the expressions in the SELECT statement only.

    The INTO clause has no impact other than creating the table based on the resulting data types of the SELECT clause.

    datatype for '15 Jan 2013' is simple, but for completeness:

    SELECT SQL_VARIANT_PROPERTY('15 Jan 2013', 'BaseType') ExpressionDataType

    varchar

    The inferred datatype for {d '2012-11-15'} is:

    SELECT SQL_VARIANT_PROPERTY({d '2012-11-15'}, 'BaseType') ExpressionDataType

    datetime

    Best Regards,

    Chris Büttner