How do I get 2 columns from a table

The simplest way to populate your database with test data.

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

How do I get 2 columns from a table

Postby Andrew Hodge » Fri Feb 17, 2012 5:51 pm

Hi,

Struggling a bit with the data generator. What I want to do is use 2 columns from a SQL Server table to populate 2 columns in an empty table

I want the 2 columns to keep there relationship to each other ie

PropertyRef1 and PropertyRef2 are related and need to populate in the new table the same.

I have tried setting the seed to 0 and changing the population but with no luck. Any suggestions
Andrew Hodge
 
Posts: 90
Joined: Thu Jul 19, 2007 8:34 am
Location: Kent, UK

Postby tilo23 » Mon Feb 20, 2012 1:34 pm

As far as I know you won't be able to do it in a simple way - but you can apply some workaround. I have this issue quite often, the MERGE script after generation works perfect for me. Details:
http://technet.microsoft.com/en-us/libr ... 10625.aspx

Seed is useful when you want to set NULLs in the same places; you may also use it if you want some columns to be identical, but doesn't work for the particular order on referencing other tables.
Inside the Dilbert's world
tilo23
 
Posts: 19
Joined: Thu Dec 22, 2011 3:56 pm
Location: Berkshire, UK


Return to SQL Data Generator 2

Who is online

Users browsing this forum: No registered users and 0 guests