We help IT Professionals succeed at work.
Get Started

query size/count of temp table

161 Views
Last Modified: 2020-02-01
I have a run longing script (30 days) and I want to see the progress/size of one of the temp tables

however this doesn't work
select count(*) from [tempdb].[dbo].[#DataToDeleteTable]

Open in new window


its says
Database name 'tempdb' ignored, referencing object in tempdb.
Database name 'tempdb' ignored, referencing object in tempdb.
Msg 208, Level 16, State 0, Line 8
Invalid object name '#DataToDeleteTable'.

Open in new window


I've also tried
SELECT COUNT(*) 
FROM #DataToDeleteTable

Open in new window


but get
Msg 208, Level 16, State 0, Line 5
Invalid object name '#DataToDeleteTable'.

Open in new window


if i run this
select * from tempdb.sys.objects

Open in new window


I see the name
#DataToDeleteTable__________________________________________________________________________________________________000000005144

Open in new window


How might I get the count of this temp table?
Comment
Watch Question
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant

An Experts Exchange subscription includes unlimited access to online courses.

Get Started
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE