[posted and mailed, please reply in news]
Hassan (fatima_ja@hotmail.com) writes:
[quoted text, click to view] > I see some temp tables in tempdb such as
> #tablename_________________________X23 as an example when i query
> tempdb..sysobjects. I noticed the create date of last month . I tried to
> do a select * from that table and it says invalid object. So how come I
> see it there ? Also how can i drop it . I am using SQL 2000.
These tables are temp tables created by some process that lags around.
The way to get rid of the tables is to kill the process. One way to
find this process is to do:
SELECT * FROM master..sysprocess WHERE login_time < @crdate
where @crdate is the creation-data for the temp table. But before you
kill any process, check that it is not doing anything useful.
Restarting SQL Server as suggested in another posting is a more
definitive way to get rid of them.
--
Erland Sommarskog, SQL Server MVP, sommar@algonet.se
Books Online for SQL Server SP3 at