select into.. "datetime"

  • I doing select into for some tables from SQl 2005 database to SQl 2008 which has few date fields, the date fields are "smalldatetime" data type in the source db but i am getting "datetime" in hte destination db, why?

  • Tara-1044200 (7/25/2011)


    I doing select into for some tables from SQl 2005 database to SQl 2008 which has few date fields, the date fields are "smalldatetime" data type in the source db but i am getting "datetime" in hte destination db, why?

    When you go across server instances, SELECT INTO isn't 100% faithful on datatypes nor IDENTITY columns.

    Use a CAST in your SELECT INTO for this problem.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply