the tempdb data file is 5GB. currently only 20MB used. we need to shrink this to 1GB as it is a small database.
(the programmer code had a problem - was mistakenly inserting and deleting in a loop and hence the log became too big- this is fixed now)
the shrink does not happen with the DBCC command.
I looked at
for troubleshooting ideas:
*There is enough space on disk
*select count(1) from sys.dm_tran_active_snapsho
ons is 0
Is it possible with SQL Server DMVs or other in-built tools to find out exactly what is occupying tempdb or blocking a shrink
select count(1) from master..sysprocesses where dbid = db_id ('tempdb') is also zero.