Doing it this way takes way too long
Well, if it's too long, the cursor is probably where you are getting stuck, you may just be unfamiliar with a few tricks we might use to speed it up, so even though it loops you'd get more done per pass. If you can post the schema/sample data/code/.sqlplan, we can help you work with that. However...
so I stored my neural network's values as variables and this works well since the values that must be updated are stored in memory.
To clarify, did you store the values as variables, or as a Table Variable? A table variable can write to disk just like a temp table can.
I know ssis allows one to cache tables but then they're read only lookup tables, is there any way to cache a table so that it's updatable?
The only cache'd tables I'm familiar with in SSIS are either Object Recordsets or RAW files. The Object Recordsets can be manipulated in script components as updateable, but you'd need to be familiar with the structure of them. RAWs are written in stone. You'd have to re-write the RAW to change it. If it's neither of these, can you drop the BOL page for what you're using here? I may just be mind-blanking on it.
Is this maybe possible in SQL through SQL server analysis services?
SSAS isn't going to go where you want here either. All a cube really does is pre-aggregate data prior to slice and dice while giving you a convienient way to reorganize the data in all sorts of different pivots. It doesn't do any heavy logic or recursion. Well, not without boatloads of MDX coding that I personally wouldn't even attempt, that's not really what it's there for.
So, really, this comes back to the first part of the issue. You're running what you're already aware is probably a non-optimal script and the time it's taking is far too long. I'd start there. If you're not sure of what-all we'd need to be able to assist you with the least amount of clarifications and double checks, read through the link in my signature for index/tuning assistance. We'll need most of that anyway before we can help you without guessing too much to fill in the blanks.
- Craig Farrell
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake. For better assistance in answering your questions | Forum Netiquette
For index/tuning help, follow these directions. |Tally TablesTwitter: @AnyWayDBA