Identity Column

  • Guys,

    I have a database with tables that have identity columns in the tables. I created a new database on a diffent server with the same tables. Now, I can I move the data accross to the new server/database with the same identity column?

  • SET IDENTITY_INSERT yourtablename ON

    insert into yourtablename select * from oldserevrname.olddb.dbowner.yourtablename

    You need to create linked server from new server to th old one. Or transfer tables to new server using DTS.

  • might need to "reseed" the desitnation table when you are done as well.

    dbcc checkident

    Steve Jones

    sjones@sqlservercentral.com

    http://www.sqlservercentral.com/columnists/sjones

    The Best of SQL Server Central.com 2002 - http://www.sqlservercentral.com/bestof/

    http://www.dkranch.net

  • Easiest way would be to simply restore a backup of your database on the new server. Otherwise both Allen and Steve are correct.

    Gary Johnson

    Microsoft Natural Language Group

    DBA, Sr. DB Engineer




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

Viewing 4 posts - 1 through 3 (of 3 total)

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