Skip to content
Home » database

database

T-SQL Tuesday #152 – Which version of my database was deployed? It depends!

This month’s T-SQL Tuesday is hosted by Deb the DBA (b|t), who invites us to give a long rant about a question that a coworker could be asking us, without knowing what they’ve just gotten themselves into by doing that.

Well… I’ve got just the thing 🤭

Read More »T-SQL Tuesday #152 – Which version of my database was deployed? It depends!

T-SQL Tuesday #143 – Short Powershell code to move DB files in AlwaysOn

This month’s #tsql2sday is hosted by John McCormack who asks us to share some useful snippets of code that can help us in our everyday jobs.

Well, honestly, this is more or less what my blog is mostly about anyway: sharing insights, scripts, and code snippets that I found to be helpful in my day-to-day job as a SQL Server consultant.

Read More »T-SQL Tuesday #143 – Short Powershell code to move DB files in AlwaysOn

Is Azure SQL Analytics all you need for SQL Server Monitoring?

How well can you monitor Azure SQL Databases and Azure Managed Instances without any 3rd party tools? Is Azure SQL Analytics really good enough for the job? Can it be a decent competitor to powerhouses such as SentryOne, Red-Gate, Apex, Solarwinds and others? Can you use it as a cheap alternative in the cloud? Will I ever stop asking questions and get to the point already? Yes, of course I will! Just keep reading.

Read More »Is Azure SQL Analytics all you need for SQL Server Monitoring?

The Ultimate Compression Savings Estimation Script for an Entire Database

Data compression in SQL Server can definitely go a long way in saving storage space, as well as improve performance. It can especially be significant in very large databases. But in certain scenarios it can actually cause more harm than good, and it’s important to identify these scenarios.

I wrote this script which performs compression savings estimation checks for an ENTIRE database. Yeah there are plenty such scripts out there already, but there’s something in particular that they all seem to be missing, and that is the ability to actually generate the relevant remediation commands for you. After all, ain’t nobody got time for writing all those “ALTER TABLE/INDEX” commands themselves!

This is why I created the T-SQL script below. Check out the “messages” tab once the script completes execution, to find the resulting remediation commands. In addition, you will also get a query result with full details.

The script also performs various checks to determine whether PAGE or ROW compression type would be more beneficial (based on stuff such as range scans vs. updates percentage, difference in compression savings, etc.). It has several parameters at the top to control various thresholds and behaviors, so that you could fine tune it for your specific database.

Read More »The Ultimate Compression Savings Estimation Script for an Entire Database