Solved

Auto fill a test database

Posted on 2009-04-13
5
561 Views
Last Modified: 2012-05-06
Hello experts,

I need to build a test database with already defined table and column structures. However, I have no data in those tables and columns. I am building several queries and I am hoping to test them against some "close-to-real" data.

So, I am looking for a solution that will automatically generate logical data into these tables. (like date values to dates column, strings into text column, etc) I also want this solution to be more flexible, like I would tell this solution to generate say 100 rows of data or generate the dates with an hour interval.

Obviously, such a query can be built from scratch but i do not want to rediscover America and spend much time on something that has already been done.

Please let me know if such tool exists.

Thank you in advance
0
Comment
Question by:bozer
5 Comments
 
LVL 5

Expert Comment

by:brandonvmoore
ID: 24134662
Random dates within a specified time period is pretty easy.  And if your strings are meaningless and you don't care if they look like garbage then you could probably construct your own solution to this problem in the time it would take you to find one.

Let's say I wanted to make a random value that was between 23 and 28
1) Generate a random value between 0 and 1
2) Multiply by 5 (because 28-23=5)
3) Add 23

You can apply that logic to generate dates or characters within specific ranges.
0
 

Author Comment

by:bozer
ID: 24134687
Thank you for the comment.

However, I don't want to spend time with this for my goal is "making use of data" not creating them. That's why I don't want to create them myself, I'm hoping someone else (or a company) already coded something for this and I can use that for my needs.
0
 
LVL 2

Expert Comment

by:thomaslberg
ID: 24134689
Or if you want to spend a few bucks to have a program do it for you.

http://www.sqledit.com/download.html
0
 
LVL 5

Expert Comment

by:brandonvmoore
ID: 24134725
If you'll use your noodle for a moment you could do it yourself in about 5 minutes.  I'm also pretty lazy, which is why I'm not going to do it for you.  But for a case this simple I would certainly do it for myself before I spent money on a product.

I'm sure someone else will probably post some code that you can use eventuall though ;)
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 125 total points
ID: 24140812
>>I'm hoping someone else (or a company) already coded something for this <<
Then see here:
SQL Data Generator
http://www.red-gate.com/products/SQL_Data_Generator/index.htm
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now