Generate sample data for tables based on column type and special keywords in column name. Need to observe the following
1. populate parent tables first, then sample id from parent table for child tables. If many to many relation, need to handled a little differently.
2. if for a given db, language is other than English, translate entered data, use something similar to [login to view URL]
3. Some data is randomly obtained from a source db, others are just random datetime. Boolean, numbers and text
4. generate Address data using source db depending on specified country of db
5. Number of row recorded at a time may exceed number of rows in source table, so may need a proper query to generate sample.
6. Process need to be fast and efficient, no inserting of one value or row at a time
Interface will contain
1. Client id (which determines db name, country and language, tables/columns and their relations)
2. Number of rows
3. button to generate
4. progress bar
db is ms sql 2012
Interface: Web
Language: vb.net 2012/2013
Select Case [login to view URL]
Case InStr(ColumnName, "first_Name"), InStr(ColumnName, "firstname"), InStr(ColumnName, "fname"), InStr(ColumnName, "f_name"), InStr(ColumnName, "given_name"), InStr(ColumnName, "g_name"), InStr(ColumnName, "gname")
Dim Query = " SELECT TOP 1 Name, FROM Names ORDER BY NEWID()"
Case InStr(ColumnName, "last_name"), InStr(ColumnName, "lastname"), InStr(ColumnName, "lname"), InStr(ColumnName, "l_name"), InStr(ColumnName, "surname"), InStr(ColumnName, "family_name"), InStr(ColumnName, "familyname")
'Dim Query = "SELECT TOP 1 Last_Name FROM Last_Names ORDER BY NEWID()"
'if no last name is found for a country, use male last name as last name
Case InStr(ColumnName, "middle_name"), InStr(ColumnName, "middlename"), InStr(ColumnName, "m_name"), InStr(ColumnName, "mi")
Case InStr(ColumnName, "addr")
Case InStr(ColumnName, "city"), InStr(ColumnName, "town"), InStr(ColumnName, "township"), InStr(ColumnName, "village")
Case InStr(ColumnName, "state"), InStr(ColumnName, "st"), InStr(ColumnName, "province")
Case InStr(ColumnName, "company"), InStr(ColumnName, "firm"), InStr(ColumnName, "organization"), InStr(ColumnName, "dba")
Case InStr(ColumnName, "title")
Case InStr(ColumnName, "phone")
End Select