Randon Data Generator for a DB

Mr_Fulano
Mr_Fulano used Ask the Experts™
on
Hi, I'm using VB 2005, WinForms. I need to populate a database with several thousand  test records and was thinking of creating some sort of random data generator, where I can supply the code with a text file list of names or strings and it would populate all the fields for me. I could do one field at a time if I need to, so as not to make the code too complex.

I'd hate to have to key in each record manually as that would take a while to do several thousand.

I was thinking of designing it this way...

1) I would supply a list of names (say 100 First names) in a text file format from disk.
2). The code would scroll through the list until it stopped at some random row or name.
3). It would then take that name and add it to the the DB into a specific field.
4). I could do that for a loop until I reach row 2000.
5). I would do that for each filed or as many as I could.

Fields that I have to fill are:
FristName, LastName, MiddleName, several telephone numbers, Job Title, DepartmentName, BusinessName, StreetAddress, City State, Zip.

Now, I don't expect to automate all the row (some would be harder than others), but if I could fill the majority, it would make my job a lot easier.

Does anyone know of a better way? Or perhaps want to take a stab at doing something like this?

Thanks,
Fulano
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Top Expert 2014
Commented:
I do not understand the logic in using the file. Why not generate random strings for varchar fields and random numbers for numeric fields? or you want to use real names etc? Install the sample database (adventureworks) in sql server and copy records from employee, customer tables etc.

Author

Commented:
Hi CodeCruiser, thanks for the suggestion. Yes, I want real names, so varchar would give something like "cjejsk" rather than "Cynthia." Although your idea sounds very good, I found this site on the web that is really cool. I think I can work with this much better...

http://www.generatedata.com/#generator

Very cool site and I don't mind spending the $20.00 for that much help.

Thanks,
Fulano

Author

Commented:
Good suggestion, but I found this site and it solves my purpose much better. - Thansk!

http://www.generatedata.com/#generator

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial