copying data tables between database and keeping indexes and identity columns

  • Is there a way to copy tables between databases (ssis?) and keep the identity columns and indexes other than tsql scripts. Wondering if SSIS ever got any better at this

  • In the OLE DB Destination, you can check the "Keep identity" property.

    A simple data flow transfering data from one server to the other should suffice.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • is there a choice to keep the identity value ?

  • timscronin (10/15/2013)


    is there a choice to keep the identity value ?

    Meaning? Can you give an example?

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • He commented you could keep the identity column. If the table already exists and just copying data between databases can you keep the identity value from the originating table?

  • timscronin (10/15/2013)


    He commented you could keep the identity column. If the table already exists and just copying data between databases can you keep the identity value from the originating table?

    I'd suppose that's what "keep identity" means.

    Never tried it myself though, I always regenerate keys. They should have no meaning at all, so it shouldn't matter if they are regenerated.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 6 posts - 1 through 5 (of 5 total)

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