Options

globally set bigint and datetime

icecurtainicecurtain Posts: 15
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,

Comments

  • Options
    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:
    <?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.
    Systems Software Engineer

    Redgate Software

  • Options
    <?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"/>
    &lt;type type = "Int64"/&gt;
    
        &lt;/generator&gt;
    &lt;/generators&gt;
    

    works but thanks for the right direction
    path = C:\Program Files (x86)\Red Gate\SQL Data Generator 1\Config
Sign In or Register to comment.