Estimated Execution Plan Temp Table
Estimated Execution Plan on Temp Table
Estimated Execution Plan with #TempTable
Estimated Execution Plan MS SQL Server
Recently I encountered a problem while trying to understand the performance issues with one of my stored procedures in SQL Server 2008.
This specific stored procedure uses a #tempTable to store some data. It looks like this:
Obviously I encountered "Invalid object name '#TempTable'."
I saw some places online which suggested several things, but the best solution for this was the simplest.
1. Simply comment the "drop table #tempTable" you do at the end of the stored procedure.
2. Run the query (which will save the #tempTable).
3. Click on the Estimated Execution Plan button.
Since you have data in your #tempTable, you can run it freely.
p.s.
Don't forget to drop this table when you're done.
Hope it helped,
Elad Shalom,
CTO at ITweetLive.com
Estimated Execution Plan with #TempTable
Estimated Execution Plan MS SQL Server
Recently I encountered a problem while trying to understand the performance issues with one of my stored procedures in SQL Server 2008.
This specific stored procedure uses a #tempTable to store some data. It looks like this:
Obviously I encountered "Invalid object name '#TempTable'."
I saw some places online which suggested several things, but the best solution for this was the simplest.
1. Simply comment the "drop table #tempTable" you do at the end of the stored procedure.
2. Run the query (which will save the #tempTable).
3. Click on the Estimated Execution Plan button.
Since you have data in your #tempTable, you can run it freely.
p.s.
Don't forget to drop this table when you're done.
Hope it helped,
Elad Shalom,
CTO at ITweetLive.com
or use a table variable and forget the #tmp table altogether declare @tmp table (id int, etc)
ReplyDeleteYet sometime you can't avoid #tmp. If you inherited a stored procedure or have some awkward select with a long list of columns and a short amount of time.
DeleteI agree variable tables are usually(!) better, but you sometimes have to find fixes and workarounds to deal with what you get.
In this specific problem I had 0 time to find out what's wrong and I couldn't cought it with profiler/ sp_whosactive.
Thanks for the comment though :)
This comment has been removed by the author.
ReplyDeletejordan shoes
ReplyDeleterolex replica watches
fitflops sale clearance
canada goose sale
christian louboutin uk
canada goose uk
louis vuitton purse
reebok outlet store
lacoste shoes
north face jackets
nike air max 90
coach outlet online
air jordan shoes
ray ban sunglasses outlet
longchamp bag
ugg boots
instyler max
true religion jeans outlet
oakley sunglasses outlet
louis vuitton handbags
canada goose sale
moncler uk
coach outlet online
cheap ray bans
michael kors handbags
dolce and gabbana outlet online
jordan pas cher
longchamp outlet store
babyliss hair dryer
nike store uk
ecco outlet
kate spade bags
polo ralph lauren
cheap ray ban sunglasses
20160722caiyan
coach outlet
ReplyDeletenmd adidas
adidas yeezy
coach factory outlet
ugg boots
raybans
michael kors outlet
ugg outlet
rolex daytona
cheap oakleys
20161021caiyan
cheap jordans
ReplyDeleteadidas nmd
christian louboutin heels
oakley sunglasses
louboutin outlet
christian louboutin sneakers
michael kors outlet online
mizuno sneakers
toms outlet
adidas yeezy 350 boost
2017.3.15chenlixiang
fitflops sale clearance
ReplyDeleteferragamo belt
bape hoodie
hermes outlet online
cheap jordans
chrome hearts online
coach outlet online
kobe shoes
michael kors
off white jordan 1