With dbForge Data Generator for SQL Server, it is possible to create a new generator if the generators provided don’t suit your needs and the customization doesn’t help.
You can create a new generator as an XML file. The location of Generator files is C:\Users\Public\Documents\Devart\dbForge Data Generator for SQL Server\Data Generators
You can create a new generator either from scratch or using a template. For detailed instructions on how to generate related data elements, refer to our blog post.
dbForge Data Generator for SQL Server is supplied with a wide collection of generator templates that can be easily used for creation of your own data generators.
To create a custom generator using a template:
We provide some important XML tags to consider when creating a new generator.
Tag | Description |
---|---|
Category | the category a custom generator is added to |
Name | the name of a generator being added |
ShortName | the name of a generator that will be displayed in the Preview window |
Description | the description of a generator |
Type | the type of a basic generator on which a created generator is based |
Language | a language to assign a generator depending on a user’s locale |
Matches | auto-mapping rules |
ColumnTypes | data types for which a generator will be available |
Options | contains other tags for configuring a generator, depending on a generator type |
MinValue | the smallest possible value |
MaxValue | the biggest possible value |
ValueDistributionMode | represents how the generated values will be distributed in the column |
Expression | defines a pattern or path expression to load data |
FileName | the name of a file to load data from |
IsLoop | determines loop status |
Values | contains other tags for configuring a generator, depending on options required |
WeightedListItem | weighted item for random choice (each element in the list has a different probability for being selected) |
Weight | the probability for the item to appear in a generated dataset |
Value | Description |
---|---|
table=”” | a name of the matched table(s) |
column=”” | a name of the matched column(s) |
* |
any number of characters |
^ | strict beginning of a name, i.e. “^Test.*” means that the beginning of the name must be “Test”, followed by any characters (the valid table names may be the following: test, testing, Test123, etc.) |
$ | strict end of a name, i.e. “.*Test$” means that the end of the name must be “Test”, preceded by any characters (the valid table names may be the following: test, myTest, 123test, etc.) |
| |
“or” listing |
priority=”n” | mapping priority - the rule according to which a generator is automatically assigned to a column (the higher the number, the higher the priority; for the custom generators it should be higher than 4 because the default data type generators have a priority range of between 1 and 4) |
minlen=”n” | the minimum permissible length of a column (the parameter is ignored for varchar(max), nvarchar(max), text, ntext, image, and varbinary(max)) |
maxlen=”n” | the maximum length of a column (this parameter is optional; the parameter is ignored for varchar(max), nvarchar(max), text, ntext, image, and varbinary(max)) |