Red Gate forums :: View topic - Need to generate an XML column that is 1 GB for testing
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

Need to generate an XML column that is 1 GB for testing

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



Joined: 28 May 2010
Posts: 2

PostPosted: Fri May 28, 2010 6:06 pm    Post subject: Need to generate an XML column that is 1 GB for testing Reply with quote

I'm evaluating the SQL Data Generator and was curious to know if there were any settings to control the size of data generated for the column?. I'm using the XML generator and don't see anywhere where to specify the size of the size. BY default it seems to generate 1000 rows and two columns. The XML contains string with random text. I'd like to be able to generate the string to be 1 GB in size.

Any tips greatly appreciated.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6644

PostPosted: Mon May 31, 2010 2:39 pm    Post subject: Reply with quote

Hello,

It is possible to customize one of the generic generators and specify a minimum and maximum size for the data. In my tests, however, taking it up to 1GB tended to run SQL Data Generator out of memory, so it may not be practical to do. But if you want to try...
  • Open program files\Red Gate\sql data generator 1\userexample\config\XmlGenerator.xml in Notepad.
  • Modify it to add the "MinLength" and "MaxLength" properties as below.
  • Save it as Program Files\Red Gate\SQL Data Generator 1\Config\BigXmlGenerator.xml
  • When you re-launch SDG, your XML columns will have an "Example" category with BigXmlGenerator in it.

Here is the code for BigXmlGenerator:
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<generators>
   <generator
      type="RedGate.SQLDataGenerator.Generators.Others.XMLGenerator"
      name="BigXMLGenerator"
      description="XMLGenerator up to 1GB"
      category="Example"
      >

      <property name="Unique">true</property>
      <property name="MinLength">500000000</property>
      <property name="MaxLength">1000000000</property>

      <matches field="Col_1" score="1" minlen="5"/>

      <type sqlType="xml"/>
   </generator>
</generators>
Back to top
View user's profile Send private message
COMTIBoy



Joined: 28 May 2010
Posts: 2

PostPosted: Tue Jun 01, 2010 6:53 pm    Post subject: Reply with quote

Thanks for the tips.

Yes, you were right , in that it didn't work (got the oom ) .
I tried 500MB and 100MB and that still seemed to fail.
Oh well Sad
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6644

PostPosted: Wed Jun 02, 2010 9:31 am    Post subject: Reply with quote

The only thing I can think of would be to create a custom generator in C#, but I don't know how you'd get more capacity for more XML data. The built-in generator above uses a StringBuilder that tries to allocate the 1GB up-front, which is usually as much memory as a 32-bit .NET application can expect to use.

Here is the page regarding custom generators: http://www.red-gate.com/supportcenter/Content.aspx?p=SQL%20Data%20Generator&c=SQL_Data_Generator/help/1.2/SDG_Creating_new_generators.htm&toc=SQL_Data_Generator/help/1.2/toc52077.htm
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