Hello,I have a SP that uses 4 big temp tables and then inserts data in real sql table and then I am dropping them at the end of SP It takes so much time. more than 25 mins for only 5K rows.Now if you use temp tables in SP then sql wont create or store execution plan for that SP and it affects performance.[b]When more than 1 user tries to run this SP, does it give incorrect data??[/b]So I created 4 regular tables instead of these 4 temp tables and dropped them at the end of SP. and I see it runs in less than 2 mins.Now with this if more than 1 user tries to run this SP at a same time then it will not give correct data.So whats the best way to optimize SP with 4 big temp tables?
↧