Home > Uncategorized > Generate large random dataset in SQL server

Generate large random dataset in SQL server

_89716241_thinkstockphotos-523060154

If you would like to learn about SQL server indexes, and SQL server performance in general, but can’t get your hands on a large dataset that really tests the limits of your SQL server, then here is a script that generates a huge dataset, based on random data.

create table Test1
(
id int identity(1,1),
guid varchar(36) default newid(),
dateCreated datetime default getdate(),
number float default rand()
)

while 1=1
Begin
insert into Test1 default values
end

You just let it run for as long as you like, then stop it whenever you have enough rows.

 

Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: