Dynamic UNPIVOT Reporting on Cardinality.

Today I was diving into some extremely wide tables, I wanted to take a quick look at things like “How many unique values does this table have in every column?”. This can be super useful if you have a spreadsheet of results or a schema without effective normalization and you want to determine which rows […]

Postgres Plugin Support Added in Azure Data Studio!!

I know I have been writing a lot about ADS recently, but this is even bigger than the Notebook announcement. A Postgres plugin has been announced in the insider release of ADS, and it just works! If the term Postgres is unfamiliar – PostgreSQL is one of the preeminent open source database solutions and is […]

Update: T-SQL Notebooks in Azure Data Studio

It’s only been ten days since my first post about ADS Notebooks, and the team has already pushed out some super useful updates. Now launching an Azure Data Studio Notebook now is almost instantaneous. You are not prompted to install the other kernels unless you select them. When reopening a file, you no longer are […]

Removing non-numeric characters from a SQL Server field without UDFs or Regex

A great question came up in the SQL Community Slack today: I saw this as a great modification on my earlier post, and wanted to show another way to implement the same solution. Walking through the steps: First, use sys.objects as our example “target” and assume the string has less than 2024 characters (spt..numbers isnt […]

How long did that last PowerShell command take?

Today Thomas Rayner’s post on Get-History reminded me of a one liner I use to calculate time spent on the last command.

  You can select any property from the output and get just the TotalSeconds, but I like this simple output for when I have to leave some work in progress and I […]

Slack Asks: Scripting out all objects from a SQL Server database with PowerShell and dbatools

@brianszadek says: I am looking to automate the scripting of objects with PowerShell for easier source control integration. I thought this would be a little bit easier, but it looks like the SMO way of doing this is still fairly complicated. Maybe something I can look at simplifying for the project in a bit 🙂 […]