MS SQL Database bloated and diskspace

I have a very old database  on an very old server

The database has a table that has gotten bloated and is eating up drive space.

When I try and delete rows from the table I get a tempdb out of space

I cannot add drive space.  

What are my options?
Larry Bristersr. DeveloperAsked:
Who is Participating?
 
65tdConnect With a Mentor Commented:
As above try shrinking the database files as well.
More info on tempdb:
https://technet.microsoft.com/en-us/library/ms190768(v=sql.105).aspx

Are the DB files on the OS drive?
0
 
Vitor MontalvãoConnect With a Mentor MSSQL Senior EngineerCommented:
Check if you can shrink the transaction log files to free some disk space for the tempdb.
Also check if there are non database files in that disk that can be deleted.
0
 
Scott PletcherConnect With a Mentor Senior DBACommented:
Agree with Vitor, you can probably get some disk space by shrinking log files.

Still, it's odd that tempdb would run out of space, unless you have some type of replication, CDC, snapshot, etc., on the table.  Or the db log file is on the same drive as the tempdb file(s) and the tempdb files are growing for a different reason.

If there is a temp-using process on the db, temporarily (or permanently?) stop/disable the activity that requires tempdb space, then try the deletes again.  

If you're deleting lots of the table, it's usually much more efficient to write the good rows to another table, TRUNCATE the original table, then copy the good rows back in.
0
 
NerdsOfTechTechnology ScientistCommented:
First, I recommend to troubleshoot the error:

https://technet.microsoft.com/en-us/library/ms176029(v=sql.105).aspx
0
 
Larry Bristersr. DeveloperAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.