Hello,
The database on one of my server's is running out of space. Is error is that there is no space on the drive which has the database the mdf file.
Here is a background on what has happened.
The disk space was full due to an bad T-SQL code . While the bad code which caused the error has been fixed and the table truncated, the OS hasn't got the storage space back. There are other data files from other DB located on the drive which is running out of diskspace.
I ran the DBCC shrinkfile it still doesn't release the disk space to the OS. Upon investigation found that the Initial Size of the mdf file was set to 1.76 TB. I figured the space used by the database mdf file was far less that the initial size. So I decided to set the Initial Size to the space used by the database file (instead of 1.76TB set currently) and then issue a DBCC shrinkfile.
The step to reduce the Initial Size to space used is running since a very long time.
Is there any better way to reduce the initial size of the db? I'd like to set it to the space currently used by the DB
Appreciate your inputs!