Question about active temp tables


i have been experiencing issues running queries on our sql server. i've been getting linked server null errors when using opendatasource open , import excel file. long story short, has been happening quite time, has gotten worse of late. so, i'm checking more.

while looking through performance counters, noticed following counter says there 24 active temp tables.

sqlserver:general statistics:active temp tables    = 24

so, ran following query @ these temp tables.

select  *
from    tempdb..sysobjects
where  name '#%'


it of course listed 24 temp tables. had hexadecimal names starting temp table # sign. xtype = 'u' , had crdates spanning 5 days ago through today. refdate same crdate in cases.

basically i'm wondering 3 things.

  1. is odd have many (24) active temp tables?
  2. can remove these safely?
  3. how tell process or script created these?

also, there reference how use system monitor , performance monitor diagnose problems? instance, learning locks. how many locks good/bad. when lock bad , makes way? when scanning on tools problems might exist (certain counters high, dates old, etc.)?

thanks in advance!
nathon dalton


nathon dalton
software developer
systems administrator
network administrator
blog: http://nathondalton.wordpress.com

try applying sp3 instance , recheck problem.  build 3152 had fix in involved temporary tables not being cleaned correctly.  had problem 3 years ago, , cu fixed problem (http://support.microsoft.com/kb/933097/)


50000874 when stored procedure runs outside explicit transaction, temporary table in stored procedure not cleaned correctly.

jonathan kehayias
http://sqlblog.com/blogs/jonathan_kehayias/
http://www.twitter.com/sqlsarg
http://www.sqlclr.net/
please click mark answer button if post solves problem!


SQL Server  >  SQL Server Database Engine



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........