Need to generate new primary key values in DTS package

  • I am trying to do a test migration with DTS, moving data from an ACT database to a MS CRM migration database.  Both databases are on the same SQL Server Box.

    In trying to setup a test migration for just three columns, I am running into a problem where I am forced to populate the primary key (ContactId) in the target databse.  I wanted to use the primary key from the ACT database, however the datatype here is a GUID; the data type of the target primary key (ContactId) is int. 

    So basically what I need to do is generate an new uniquie interger value for ContactId for each record that I migrate.

    I cant figure out how to do this.

    Any help would be greatly appreciated!

    Thanks,

    Greg

  • Sounds like there is either a relationship or constraint set up within the ACT database.

    You either turn off the relationship or add an identity column and use the enable identity insert option when using DTS

  • You need to set the autogenerate for that column of target table to true and then every time when you will add data to this table it will automatically create the unique number in each row.So then you dont need to create unique numbers fo this primary key on your own.

    Hope this helps

    Urvashi

  • you should use cast or convert type expression so you get things as per your pattern


    Regards,

    Papillon

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

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