Exporting data and keep the primary key

Hi all,

I am rather fresh to SQL2000, so...

When I export data from database A tot database B and I look at the copied tables in database B, all the primary keys are gone and the field is now a "normal" field

How can I keep the primary key in the copied tables

Help is appreciated, Ger.

 




Answer this question

Exporting data and keep the primary key

  • New User1

    How did you export If you make a SQL copy objects task via DTS you can select if you also want to preserve the PK / index structure etc. Its one of the advanced options of the DTS Wizard.

    HTH, Jens Suessmeyer.

    ---
    http://www.sqlserver2005.de
    ---


  • wayne_p

    I have the same problem. Is there an answer to this
  • Henry Gabryjelski - MSFT

    I am using Sql Server 2005 Management Studio, I run the DTSWizard by running DTSWizard.exe from the "Run" menu. But I can not copy my database with the primary keys and relations.

    After reading your post I have tried to find the advanced options of DTS Wizard but couldnt managed to do that. If you can give detailed information I will be glad.

    Thanks in advance


  • Exporting data and keep the primary key