Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Auto fill a test database

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
tempdb log keep growing 7 33
Powershell v3 - SQLCMD 3 27
backup and restore 21 30
Use column to search string column 2 11
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

829 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