Red Gate forums :: View topic - Weighted List Custom Generator
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

Weighted List Custom Generator

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



Joined: 15 Jul 2010
Posts: 13
Location: Newport Pagnell

PostPosted: Fri Dec 17, 2010 11:57 am    Post subject: Weighted List Custom Generator Reply with quote

Hi!

Has anyone every happened to create a Custom Generator for a weighted list?

I'm struggling to find the right properties I need to set.

So far i've got the following...

Code:

<generators>
   <generator type="RedGate.SQLDataGenerator.Generators.List.WeightedListGenerator"
                   name="Yes|No"
                   description="95 | 5%..."
                   category="Weighted Lists">
      <property name="Seed">0</property>
      <property name="NullsAllowed">False</property>
      <property name="NullProportion">0.01</property>
      <property name="">ListItems</property>
      <!--<element>
                        <key type="string">ListItems</key>
                        <value version="1" type="WeightedListItems">
                           <WeightedListOfItems type="WeightedListOfItems" version="1">
                              <value version="1" type="WeightedListItem">
                                 <Name>Yes</Name>
                                 <Weight>95</Weight>
                              </value>
                              <value version="1" type="WeightedListItem">
                                 <Name>No</Name>
                                 <Weight>5</Weight>
                              </value>
                           </WeightedListOfItems>
                        </value>
                     </element>-->
      <matches field="*Option*" score="70"/>
      <type type="string"/>
   </generator>
</generators>
Back to top
View user's profile Send private message
Linda Hawksworth



Joined: 25 Jun 2007
Posts: 192

PostPosted: Wed Jan 12, 2011 1:40 pm    Post subject: Reply with quote

I have sent you a PM with some amended code.
Back to top
View user's profile Send private message
CraigOttley



Joined: 15 Jul 2010
Posts: 13
Location: Newport Pagnell

PostPosted: Tue Jan 18, 2011 2:39 pm    Post subject: Reply with quote

Thanks Linda.

For everyone else this code works for me Surprised)

Code:
<generators>
   <generator type="RedGate.SQLDataGenerator.Generators.List.WeightedListGenerator"
                   name="Yes|No"
                   description="95 | 5%..."
                   category="Weighted Lists">
      <property name="Seed">0</property>
      <property name="NullsAllowed">False</property>
      <property name="NullProportion">0.01</property>
      <property name="ListItems">
         <WeightedListOfItems type="WeightedListOfItems" version="1">
            <value version="1" type="WeightedListItem">
               <Name>Yes</Name>
               <Weight>95</Weight>
            </value>
            <value version="1" type="WeightedListItem">
               <Name>No</Name>
               <Weight>5</Weight>
            </value>
         </WeightedListOfItems>
      </property>
      <matches field="*Option*" score="70"/>
      <type type="Object"/>
      <type sqlType="Char"/>
      <type sqlType="Varchar"/>
      <type sqlType="NChar"/>
      <type sqlType="NVarchar"/>
      <type sqlType="NText"/>
   </generator>
</generators>
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