I am currently optimizing a stored procedure, because it times out due to amount of calculations and entries present.
However, I am unsure about a situation. Is it best to use 8 temp tables (which draw their information from other data in the database) or to just put the data from the database into various variables and access them?
Which would give the best performance to fix the timeout issue?