I'm very very new to sql server. I want to have a table with intra-day stock information and analytical calculation (ex. Simple Moving Average - SMA).
I've designed a table that will contain market data and imported the data to it. now I want to add the SMA to the table and save it. next day I want to add market new data and calculate based on last SMA figures of the previous day and save again to the same table.
Is it going this way in sql server or I should have a query to get the SMA and then a way to save the results to the source table because I want it in one table and not to execute the query again for the same data!
what I mean, if I don't save MVA results figures to a table (preferably source table) I believe query and calculation must be done for old data again plus the new one to get analysis for new day which is not practical.
Please guide me to the right way! and I would appreciate if it's in detail(How!).
more detail-- I'm using sql server 2008. I got all these results easily with excel and vba but because of the huge data I need to move to sql server.