Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

When should I use temporary tables? 2

Status
Not open for further replies.

joelwenzel

Programmer
Jun 28, 2002
448
I have just learned about temporary tables and am wondering when I should use them. I am currently designing a table that is very long (~500 million rows specific to a UserID and a Date) and am wondering if it makes sense to create a temporary table for users for a specific date range when the need to access the data.

Would this make sense for preforming aggregate functions?
Would this make sense for just general access (proforming no calculatons, just retreiving the data)?
What other situations should I consider temporary tables (eg Unions, etc?)?

Thanks in advance.
 
I think rather than a temporary table that would store the data that you already have,you should use a VIEW which you can perform calculations on etc. and then you aren't storing multiple copies of your records.
 
when to use a temporary table: when every other technique fails to deliver the performance required

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top