You are here

troubleshooting

TSQL - Get All Queries Currently Running

This is perhaps my most commonly used query when troubleshooting.

Autogrowth On But Database Not Growing

An issue arose where a database was giving the error:

Could not allocate space for object ‘object-name’ in database ‘dbname’ because the ‘PRIMARY’ filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.

SQL Server – Lots of Empty Space But Database Won’t Shrink

Today I ran a script to delete a huge portion of data in a DEV environment and I was excited to get back a few hundred GB, but I only got back a portion of the free space that the Properties window said I had.  What was going on?

It turns out that when shrinking a database, the smallest a file will get is back to the “Initial Size” in the database properties/files window.

To shrink it more, simply lower the Initial Size and then shrink the database again.  You can use the GUI or use:

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
1 + 7 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer