How to know spid which is filling tempdb from temp table name in sybase

sybase

I received alert that tempdb is going to be full and temp table name aslo provided.
Now I want to know how to check which spid is filling tempdb from temp tablename.

Best Answer

The best is to use the montables. Make sure you have mon tables activated. Once verified you can issue the following select statement:

select SPID, DBName, ObjectName, PartitionSize
from master..monProcessObject
where DBID = tempdb_id(SPID)
order by SPID

for more information please see the official Sybase docs: http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc00967.1550/html/MigrationGuide/MigrationGuide14.htm