Retaining Primary Key Values from Master Table loads

The simplest way to populate your database with test data.

Moderators: JonathanWatts, David Atkinson, Anu Deshpande, Michelle Taylor, Lionel, Emma A, sherr

Retaining Primary Key Values from Master Table loads

Postby zdgfastineau » Sat Jun 09, 2012 3:30 am

I need to copy a few master tables as a part of a data generation project. When I try to do this I can pull all the master tables field values except (most important) the Primary Key value. How does one keep these master tables in tact without loosing the PK value? Our code sometimes depends on these values.
zdgfastineau
 
Posts: 2
Joined: Sat Jun 09, 2012 3:13 am

Postby james.billings » Mon Jun 11, 2012 7:39 pm

Thanks for your post. Most likely is that the PK column in the target is set up as a server-assigned Identity value. SQL Data Generator will always default to leaving this as server assigned.
We do have a feature request to allow it to set identity insert to help (ref. SDG-634) but as yet it has no fix date.

The only workaround I can think of is to drop the PK before working with the tool, then putting it back afterwards?
james.billings
 
Posts: 1144
Joined: Wed Jun 16, 2010 11:10 am
Location: My desk.


Return to SQL Data Generator 2

Who is online

Users browsing this forum: No registered users and 0 guests