Red Gate forums :: View topic - Warning about schema, duplicates may be inserted
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Data Generator 2
SQL Data Generator 2 forum

Warning about schema, duplicates may be inserted

Search in SQL Data Generator 2 forum
Post new topic   Reply to topic
Jump to:  
Author Message
mglimmerveen



Joined: 13 May 2013
Posts: 1

PostPosted: Mon May 13, 2013 12:20 pm    Post subject: Warning about schema, duplicates may be inserted Reply with quote

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:

Quote:
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:
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?
Back to top
View user's profile Send private message
Manfred.Castro



Joined: 23 Apr 2012
Posts: 205

PostPosted: Tue May 14, 2013 5:25 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group