Red Gate forums :: View topic - globally set bigint and datetime
Return to www.red-gate.com RSS Feed Available

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

globally set bigint and datetime

Search in SQL Data Generator 1 forum
Post new topic   Reply to topic
Jump to:  
Author Message
icecurtain



Joined: 18 Jan 2010
Posts: 10

PostPosted: Tue Jan 22, 2013 5:56 pm    Post subject: globally set bigint and datetime Reply with quote

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,
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1117
Location: My desk.

PostPosted: Wed Jan 23, 2013 7:23 pm    Post subject: Reply with quote

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



Joined: 18 Jan 2010
Posts: 10

PostPosted: Thu Jan 24, 2013 1:58 pm    Post subject: Reply with quote

Code:
<?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:
   <type type = "Int64"/>

    </generator>
</generators>   


works but thanks for the right direction
path = C:\Program Files (x86)\Red Gate\SQL Data Generator 1\Config
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