globally set bigint and datetime

The simplest way to populate your database with test data.

Moderators: David Atkinson, Anu Deshpande, Lionel

globally set bigint and datetime

Postby icecurtain » Tue Jan 22, 2013 5:56 pm

Hi,
How can I globally set that for all Bigint and datetime data types, the default for all tables the project should be 1 thru 999,999 unique with no null ?

Date time 01-01-1901 00:00 - 01-01-1901 00:00 Randomize Time = false

which Xmls do I need to change?

Thanks,
icecurtain
 
Posts: 10
Joined: Mon Jan 18, 2010 6:11 pm

Postby james.billings » Wed Jan 23, 2013 7:23 pm

The datatypes you describe are built in ones so you can't edit an XML to override them. You can create a new one though, and give it a higher score so it gets picked up. For example the BigInt one could have a file defined as this:

Code: Select all
<?xml version="1.0" encoding="iso-8859-1"?>
<generators>
<generator type="RedGate.SQLDataGenerator.Generators.Number.Int64Generator" name="MyBigInt" description="Generates BigInts" category="Generic">
   <property name="MinValue">1</property>
   <property name="MaxValue">999999</property>   
   <property name="UseSequence">False</property>
   <property name="Unique">True</property>
   <property name="ValidateIncrement">1</property>
   <property name="NullsAllowed">False</property>
   <matches field="." score="999" />
   <type type="Int64" />
  </generator>
</generators>


You can create a new file in C:\\Program Files (x86)\\Red Gate\\SQL Data Generator 2\\Config and the tool will pick it up. The field name matching takes a regular expression, so a . simply means "anything" - thus all fields with a bigint datatype will use this generator.

You can do a similar process to create other generators too.
james.billings
 
Posts: 1144
Joined: Wed Jun 16, 2010 11:10 am
Location: My desk.

Postby icecurtain » Thu Jan 24, 2013 1:58 pm

Code: Select all
<?xml version="1.0" encoding="iso-8859-1"?>
<generators>
    <generator
        type = "RedGate.SQLDataGenerator.Generators.Number.Int64Generator"
        name = "BigInt"
        description = "Generates BigInts"
        category = "Generic">
        <property name = "MinValue">1</property>
        <property name = "MaxValue">999999</property>
        <property name = "UseSequence">False</property>
        <property name = "Unique">True</property>
        <property name = "ValidateIncrement">1</property>
        <property name = "NullsAllowed">False</property>
        <matches field = "." score = "999"/>


<type type = "bigint"/>

Code: Select all
   <type type = "Int64"/>

    </generator>
</generators>   


works but thanks for the right direction
path = C:\\Program Files (x86)\\Red Gate\\SQL Data Generator 1\\Config
icecurtain
 
Posts: 10
Joined: Mon Jan 18, 2010 6:11 pm


Return to SQL Data Generator 1

Who is online

Users browsing this forum: No registered users and 0 guests

cron