astromenix
Technical User
hello,
I m in the situation that I got to calculate room prices for given periods and depending on their occupancy generate different prices and then apply discounts on each day.
So I need at some point, when i get data of different tables to loop through each date from check_in and check_out dates. I m wondering, whether is wise to use a select to limit the records based on the check_in and check_out dates and then store them in a table variable. Then instead of looping and select price of the original tables, use the table variable(s).
I m concerned of whether that will be costly in terms of memory (as table variables if got not too many records stored entirely in memory) and database performance to keep my data in table variables.
I was also thinking to store in different variables the prices of different types of discounts and meal prices as they also are dependent to periods.
I would appreciate any advice and thoughts
Thanx a lot
Astromenix
I m in the situation that I got to calculate room prices for given periods and depending on their occupancy generate different prices and then apply discounts on each day.
So I need at some point, when i get data of different tables to loop through each date from check_in and check_out dates. I m wondering, whether is wise to use a select to limit the records based on the check_in and check_out dates and then store them in a table variable. Then instead of looping and select price of the original tables, use the table variable(s).
I m concerned of whether that will be costly in terms of memory (as table variables if got not too many records stored entirely in memory) and database performance to keep my data in table variables.
I was also thinking to store in different variables the prices of different types of discounts and meal prices as they also are dependent to periods.
I would appreciate any advice and thoughts
Thanx a lot
Astromenix