Solved

Auto fill a test database

Posted on 2009-04-13
5
563 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Slow Connectivity over ODBC 8 36
migration MS SQL database to Oracle 30 61
CPU high usage when update statistics 2 30
SQL - Update field defined as Text 6 17
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
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…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

809 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