Storing values until ready to write to table - best way to do it

Using stored procedures to calculate - data has about 15 records all related to one test - each having tehir own set of calculated results.  We hav to loop through them - Debating right now what would be the best way to stor this data - write each calculation into a temporary table, wait until the whole row of calculations are done and then write to final table, cursors (although I don't think that'd be a good idea) just use variables - an array doens't meet our needs.  A hash table woudl but is their an equivalent in stored procedures??
MosquitoeAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Aneesh RetnakaranConnect With a Mentor Database AdministratorCommented:
>write each calculation into a temporary table, wait until the whole row of calculations are done and then write to final table
This is a better option and even better option will be the one which replaces the temp table with a table variable
0
 
MosquitoeAuthor Commented:

What is a table variable?  
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
table variable is similat to TempTable , you can use it as u use a temp table;also it has some performance gain over temp tables if you deal with less no of records


declare @Tab Table( i int, name varchar(100) )
0
 
MosquitoeAuthor Commented:

Can you supply me with a link on MSDN - I cannot find it ..
0
All Courses

From novice to tech pro — start learning today.