You are here: Temp tables vs table variables « MsSQL Server « IT news, forums, messages
Temp tables vs table variables

Posted by serge on 10/05/45 11:34

I am running SQL Server Best Practices on a SQL 2000
database and it is recommending me to change the temp
tables inside SPs to table variables.

I had read already in other places to use table variables
over temp tables. I also know I can't create indexes as
I can on temp tables. Instead I'll have to create either
a primary key and/or a unique index on a table variable.

One question I have is let's say I will be putting thousands
of records in a temp table, should i still choose a table
variable over a temp table for this? Or is there a
recommended limit where if I have to store certain
number of records then it's better to store them in
a temp table rather than a table variable? Or number
of records is not the factor to decide whether to use
temp tables or table variables?

I would like to know when it's ideal or best to use
temp tables instead of table variables and vice versa.

Thank you

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация