Skip to content
Home » Tools and Scripts » Page 2

Tools and Scripts

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

Finding a use for Extended Properties in SQL Server

“Extended properties allow you to add custom properties to database objects”, so says the official Microsoft documentation. However, very few DBAs make use of them, if at all. This is actually a good thing, because indeed the scenarios in which this feature could be useful are relatively few and rare.

On the other hand, I also see DBAs essentially jumping through hoops to implement something, which could in fact very easily be implemented using Extended Properties.

What are these peculiar use cases? Let’s look at a few examples.

Read More »Finding a use for Extended Properties in SQL Server

Even more fun with DATETIME arithmetics!

In one of my previous posts, Fun with DATETIME Arithmetics, I introduced a way to use “math” to manipulate datetime values for effectively generating, calculating, and displaying intervals (i.e. difference between two datetime values). These mostly work with the addition and subtraction operators (+, -).

In one of the paragraphs, I mentioned multiplication and division, and posed the question about why anyone would ever need to do this.

Read More »Even more fun with DATETIME arithmetics!

One handy Powershell script template to rule them all

If you know me, you already know that I’m a huge fan of automation. Therefore, it’s natural to assume that I would dabble in Powershell at least once or twice or a few dozen, as a method to implement useful automations. After all, automation is pretty much the whole essence of Powershell in the first place.

As I used Powershell scripts more and more, I learned that there are a few things that are important to have whenever you use such scripts as part of automation (by “automation” I mean any sort of operation done “unattended”, i.e. without direct human interaction in real-time).

Read More »One handy Powershell script template to rule them all

Keep Your MSDB Clean

As part of its regular, ongoing, day-to-day activities, your SQL Server instance would naturally collect historical data about its automated operations. If left unchecked, this historical data could pile up, leading to wasted storage space, performance hits, and even worse issues.

MSDB would obviously be collecting data about the SQL Agent job executions. But there are also several other types of historical data that needs to be cleaned up once in a while. I hope to cover all bases and leave no historical data un-cleaned.

Read More »Keep Your MSDB Clean

Monitoring SQL Server Version Updates using SentryOne

Following the recent acquisition of SentryOne by SolarWinds, I’ve decided to write a few special blog posts dedicated to our favorite SQL server monitoring platform.

Click here if you missed my previous post: Common issues during SentryOne version upgrades.

As part of the managed DBA service that Madeira data solutions provides, we make extensive use of the SentryOne monitoring and alerting platform. As such, we’ve gathered significant experience in using, managing, and maintaining the platform.

This also includes utilizing the platform to do all kinds of “unorthodox” monitoring, which is not available “out-of-the-box”.

Read More »Monitoring SQL Server Version Updates using SentryOne

SQL Vulnerability Assessment Tool Reference List – Updated!

Way back at January 16, 2020, I published a blog post containing a reference list for the many rules checked by the SQL Vulnerability Assessment Tool. The next month, I created a separate, dedicated page for the reference list so that it’d be easier to find and maintain. Today I learned that a few months later, around the beginning of May, Microsoft themselves have also published such a reference list on the Microsoft Docs page.

Read More »SQL Vulnerability Assessment Tool Reference List – Updated!