It always varies according to your scenario.
In general, for small tables, Table variables are faster.
But if you stock large chunks and you want to index them, then Temp table is your best bet.
Main Topics
Browse All TopicsWhich one is quicker
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
It depends:
http://www.sql-server-perf
Thumb rule: Temp Variable will suffer in performance for huge data as everything needs to be in cache compared to Temp table.
"If you need a temporary table in your Transact-SQL code, consider using a table variable instead of creating a conventional temporary table instead. Table variables are created and manipulated in memory instead of the tempdb database, making them much faster in some cases. But not in all cases. Because of this, you will need to test both options to determine which works best for you under your particular circumstances.
In addition, table variables found in stored procedures result in fewer compilations (than when using temporary tables), and transactions using table variables only last as long as the duration of an update on the table variable, requiring less locking and logging resources. "
Reference from:
http://www.sql-server-perf
P.S: These parameters depends upon your tempdb contention and your tempdb files..
Hence test once before implementing any..
Hello KaranGupta,
>As my knolwdge I think Table Variable is faster because it is only allocated in memory
thats not true, it wont store the data in memory both of them uttolise space on tempdb
as far as your question is concerned i agree with the posts of emoreau and Jegan, It depends on the scenario, as a thump of rule if the no of entries to store is less than 10000, go for table variable, else use temptable, while using the temp table, you can create the index (if any needed) after populating the data
Regards,
Aneesh
aneeshattingal:
you are right it is stored on tempdb
For a little comparison check this article
http://databases.aspfaq.co
Thanks
Business Accounts
Answer for Membership
by: aymoon80Posted on 2009-11-02 at 03:03:21ID: 25718417
As my knolwdge I think Table Variable is faster because it is only allocated in memory but Temp table required I/O operations becuase it is created on the database on the physical drive