Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Posts
    193

    Unanswered: Can DTS automatically create primary key values upon export?

    I have two practice tables I have created and want to export the values of one into the source table. I want to know if I can export into a table and have the destination table automatically give a primary key value to a record? I haven't been able to figure this out even after fiddling with the "Enable identity insert" checkbox under the Column Mappings tab. I have created source tables with and without primary keys and neither works because of the fact that I need to have a value for a primary key in order to INSERT into the destination.

    Do I have to copy the source records into a staging table and assign the PK values myself by hand? This can't be the answer.

    ddave

  2. #2
    Join Date
    Feb 2004
    Location
    San Antonio, TX
    Posts
    565
    you have to clear the enable identity insert checkbox if you want to allow the identity values to be poped by you
    adding a check indicates that you want to programmatically provide the identity values
    try clearing it and setting your identity on the column

  3. #3
    Join Date
    Feb 2004
    Posts
    193
    Thanks. I did do as you mention but I also had to create the destination table with a Primary Key with an identity field that incremented automatically by 1. I also had to create a source table that had NO primary key field. I then imported the source into the destination and the incoming rows were assigned Primary Key values in sequence.

    ddave

    Quote Originally Posted by Ruprect
    you have to clear the enable identity insert checkbox if you want to allow the identity values to be poped by you
    adding a check indicates that you want to programmatically provide the identity values
    try clearing it and setting your identity on the column

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •