Ive been recently handed a very old access database to convert over to SQL server. It was done in the 90's by others but I have the .mdb files
The database is very old but has the customers actual formulation data that id like to keep. It is structured in separate tables as follows..
Tables
Formulas
Formula_000
Formula_001
Formula_002
As you can see above there is a header formula table with details such as name, date, version etc like so..
Table [Formulas]
------------------------------------------------
| FORMULA NAME | ID | VERSION | CREATED |
| Formula_000 | 000 | 1 | 01/01/1997
| Formula_001 | 001 | 1 | 01/01/1997
------------------------------------------------
There is a separate accompanying table which holds the ingredients to go with each entry in the Formula table, so there is a table called [Formula_001] with the following columns inside..
Table [Formula_000] (x 100)
material code | % |
material 1234 | 025 |
material 5678 | 075 |
------------------------------------------------
Id prefer not to have all these tables linked by a header table, but I need the data into a new structure. There are hundreds of these tables named Formula_xxx
What I want to do is loop through all the MS access tables in the above database except the header table [formulas] (i can delete this one to make it easier) , and copy them into a new master table, with an extra column with the formula number to identify which table it came from. Example below..
Table [Formula_Ingredients]
material code | % | formulaID |
material 1234 | 025 | 000
material 5678 | 075 | 000
material 1111 | 025 | 001
material 2222 | 075 | 001
------------------------------------------------
Any ideas guys?