bob fitz
AWF VIP
- Local time
- Today, 18:45
- Joined
- May 23, 2011
- Messages
- 4,719
In my app I have a table called "tblHistoricalDataMASTER" that is derived from a spreadsheet. It has data about the price of shares e.g.
I have written a function that steps through this table and writes the values to another table called "tblHistoricalDataMASTERTrans" that looks like this:
The function does the job but looping through 200k records and creating 800k new records takes longer than I would like it to.
Can anyone suggest a quicker/better way of achieving this. Perhaps with some kind of query?
ID | Open | High | Low | Close | Ticker | StockDate2 |
1 | 42.049999 | 45 | 38 | 38.23 | FB | 5/18/12 |
I have written a function that steps through this table and writes the values to another table called "tblHistoricalDataMASTERTrans" that looks like this:
HistID | Ticker | StockDate | PriceType | StockValue | MasterID |
1 | FB | 5/18/12 | Open | 42.049999 | 1 |
2 | FB | 5/18/12 | High | 45 | 1 |
3 | FB | 5/18/12 | Low | 38 | 1 |
4 | FB | 5/15/12 | Close | 38.23 | 1 |
Can anyone suggest a quicker/better way of achieving this. Perhaps with some kind of query?
Last edited: