In my last article - Identify Tables With Dropped Columns - we saw how we can identify tables that have columns that were dropped. Today, we are going to check a way to approximately calculate how much space we can expect to recover if we rebuild our table.
If you want to read the 1st article I published on this subject, you can read it here - What happens when we drop a column on a SQL Server table?
On my last article - What happens when we drop a column on a SQL Server table? Where’s my space? - I have shown what happens when we drop a column from a table.
Today, we are going to check if we have a way to find tables with dropped columns.
Why? As we learnt, when we drop a column this is just a metadata operation and won’t clear the space that was being used.
This article was initially posted on SQLServerCentral @ 2024-04-26.
Short answer: The column is marked as ‘deleted’ and will stop being visible/usable.
But, most importantly - The record/table size will remain unchanged.
A metadata operation Dropping a column is a metadata/logical operation, not a physical one. This means that the data isn’t removed/overwritten by this action.
If we were talking about deleting data (records), as Paul Randal mentions here :
A couple of days ago I was doing some cleaning on some Azure SQL DBs and shrinking some files to lower the bill.
To check my progress I needed to check the size before/after the task in an easy way for multiple Azure SQL DBs.
Check Azure SQL DB storage space for 1 database If you need to check the storage space being used by 1 Azure SQL DB, that is as easy as jumping on the portal, select the desired database and you can find the information in the Overview.
At the beginning of this week, I shared how you can Search for queries with Query Store GUI .
Today I want to share something, Query Store related, that bugged me for awhile and a workaround to overcome it.
NOTE: This happens at least until SSMS v19.3 (most recent version of SSMS at the time of this writing). Let’s see what newer versions bring us.
Multiple instances of the same dashboard When you navigate through Query Store dashboards, it can become handy open two instances of the same dashboard but with a different time range, or different aggreagations or even a different metric so you can do a quick compare.