Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Quick and dirty way to make a very large table

By Gaby Abed,

Here's a quick and dirty way to generate massive amounts of data. Basically the columns are in the form of: Identity(1,1), datetime, uniqueidentifier1...uniqueidentifierN

and the uniqueidentifier columns are set to populate automatically. I generated about 1 Gig (260000 rows of max rowsize about 8000) in 3.5 minutes on my simple basic desktop. I've limited it to 8000 so it would work with SQL 2000 but not sure how massive you could make it on 2005/2008. The reason for doing it this way is all the other ways that use checksum for example, take a couple hours to generate 1 Gig of Data.

I did notice when I had the columns be defaulted as part of the definition, the generation was quicker than inserting a newid() for all applicable columns.

One more thing, to speed up the generation, set the database this table is located in to grow in magnitude of 500MB chunks at a time rather than a percentage, as it will greatly speed up the generation.

Total article views: 1292 | Views in the last 30 days: 1
 
Related Articles
FORUM

Write Query Dynamic Generated Column

Write Query Dynamic Generated Column

SCRIPT

SQL Script to generate columns for triggers

SQL Script to generate columns for triggers

SCRIPT

Generate Column Metadata

This utility will generate column and parameter metadata in various useful formats for tables, views...

FORUM

Generate extract with varrying column size

Generate extract with varrying column size

SCRIPT

Generate INSERT for table with IDENTITY column

Generate a "INSERT INTO...SELECT FROM" script for a table with an identity column.

Tags
large data    
large table    
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones