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!

Efficiency question on temp tables - delete vs drop

Status
Not open for further replies.

DarwinIT

Programmer
Apr 25, 2008
142
US
I'm looping through a stored procedure - processing 1000 records at a time. I create a #temp table (using dynamic sql so I can't use a table variable from what I saw) When I process those 1000 records, I want to reload. It is more efficient to drop and recreate the table or issue a delete command to remove the existing records?
 
I suspect the most efficient method will be to truncate it.

[tt]Truncate Table #[!]YourTempTableName[/!][/tt]

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top