troubleshooting Question

query size/count of temp table

Avatar of websss
websssFlag for Kenya asked on
DatabasesMicrosoft SQL Server 2008Microsoft SQL ServerMicrosoft SQL Server 2005
2 Comments1 Solution172 ViewsLast Modified:
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]

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'.

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

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

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

I see the name
#DataToDeleteTable__________________________________________________________________________________________________000000005144

How might I get the count of this temp table?
ASKER CERTIFIED SOLUTION
OMC2000

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros