Warning about schema, duplicates may be inserted

The simplest way to populate your database with test data.

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

Warning about schema, duplicates may be inserted

Postby mglimmerveen » Mon May 13, 2013 12:20 pm

Hello,

I am trying to create test data, by creating a schema based on the database schema of the TPC-C benchmark. I also added some indexes, but now I encountered a weird warning from SQL Data Generator:

Warning: Duplicates may be inserted. Set unique is not selected for any columns in unique constraint PK_STOCK item/warehouse


This unique constraint is a composite primary key, consisting of two fields:
Code: Select all
constraint PK_Stock PRIMARY KEY CLUSTERED(item, warehouse)

As far as I understand it, this means that the combination of the two fields is unique. So, why would I need to select unique for either of the two fields? Am I missing something, or is this a bug?
mglimmerveen
 
Posts: 1
Joined: Mon May 13, 2013 11:32 am

Postby Manfred.Castro » Tue May 14, 2013 5:25 pm

You will have to select either of the fields to be unique in order to guarantee that the generated data will satisfy the unique constraint. Without setting either of the columns to unique the generated data may not satisfy the constraint because the tool may generate data that is not unique for the combination of the two fields.
Manfred Castro
Product Support
Red Gate Software
Manfred.Castro
 
Posts: 209
Joined: Mon Apr 23, 2012 2:49 pm


Return to SQL Data Generator 2

Who is online

Users browsing this forum: No registered users and 0 guests