Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Execution plans and temp tables

Author  Topic 

SamC
White Water Yakist

3467 Posts

Posted - 2003-08-07 : 22:54:03
I can't seem to get an execution plan on a stored procedure that uses a temp table.

Server: Msg 208, Level 16, State 1, Line 11
Invalid object name '#temptable'.

Is this a limitation of the execution plan generator or is it something else?

Sam

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-08-07 : 23:09:27
Ummmm....some code might help.
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2003-08-08 : 02:31:05
You can't get an estimated plan but you can get the actual plan from the execution.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2003-08-08 : 07:27:58
Nigel's correct. I can't get an estimated plan.

How do I get an actual plan?

Sam
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2003-08-08 : 07:40:10
In query analyser select "show execution plan"

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2003-08-08 : 07:57:50
Thanks Nigel.

Oh.. and Press F5 to execute .

Sam
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2003-08-08 : 07:59:16
One more question.

Are the execution percentages of "show execution plan" actual runtime results?

Sam
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2003-08-08 : 08:10:07
Um, er, maybe.
I did a lot with this with v7 and sometimes reducing a high percentage value didn't have much affect on the query. Think that was because the data was already in memory so although it had a high cost it actually took very little time.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2003-08-08 : 09:57:15
Sam worry more about what it's showing you...like table scans...fix those things....

7 and Counting



Brett

8-)

SELECT POST=NewId()
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2003-08-08 : 11:16:01
I'm working on my acceptance speach now...

I'd like to thank everyone here at SQLTEAM who has been so helpful. I couldn't have done it without you....

I've got to hit 1K in 30 min - I'm gone for the better part of the day at 11:45.

Sam
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2003-08-08 : 11:34:22
quote:
Originally posted by SamC

I'm working on my acceptance speach now...

I'd like to thank everyone here at SQLTEAM who has been so helpful. I couldn't have done it without you....

I've got to hit 1K in 30 min - I'm gone for the better part of the day at 11:45.

Sam



Or you can just hang out at 999....



Brett

8-)

SELECT POST=NewId()
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2003-08-08 : 11:49:32
But that would be imitation.

Nuts, I'm late and gotta go. That means I'll hit 1000 over the weekend.

I didn't time my moment of fame.

See you later Brett.

Sam
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2003-10-26 : 22:47:32
Show Execution Plan doesn't work at all today. I get no error, no message.

What's up with that?

Sam
Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2003-10-26 : 23:09:01
Daylight savings

Damian
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2003-10-26 : 23:11:25
Wait Damian wait! You mean I have to wait till next spring for Show Execution Plan to work again?

Sam
Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2003-10-26 : 23:17:50
You could send it here, and I could run it for you.
Then I'll send you mine in May when mine stops.



Damian
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2003-10-26 : 23:43:49
You're wide open for a response like this:

Thanks Damian, so you can access the database, I've setup your username: damian, password: <punch line here>

Sam
Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2003-10-26 : 23:55:17
just leave it blank. Thats how they showed us at the MSDN dev days!


Damian
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2003-10-27 : 00:14:09
Yep, a blank is a cliffhanger.

It's way late here. Gotta go.

10-4 good buddy. Over and out.

Sam
Go to Top of Page
   

- Advertisement -