Install SQL Server Command Line Tools on a Mac

mssql-tools is a command-line utility developed by Microsoft that provides tools for interacting with Microsoft SQL Server environments. It includes sqlcmd for executing Transact-SQL (T-SQL) queries and scripts, and bcp (Bulk Copy Program) for importing and exporting large volumes of data. These tools can be useful when you want to manage SQL Server directly from the terminal without relying on graphical interfaces.

One cool thing about mssql-tools is that it’s cross-platform. It can be installed on macOS, Linux, and Windows machines. This makes it ideal for modern development environments, especially when working with cloud-based solutions like Azure SQL Database.

In this article, we’ll look at how to install mssql-tools on a Mac and use it to connect securely to an Azure SQL Database.

Read more

Create a Resource Group in the Azure Portal

An Azure resource group is a container that logically organizes related Azure resources, allowing for easier management, deployment, and access control of those resources. When we do things like create a SQL database, we need to create a resource group for the database to belong to. We can create the resource group while creating the database, but we can also create the resource group separately.

This article shows the steps for creating a resource group separately, from the Azure portal home page.

Read more

Quick Overview of the List Operators in DuckDB

DuckDB provides us with a bunch of functions and operators that we can use when working with lists. These include operators for doing things like concatenating lists to performing calculations on the lists. Most of these operators are aliases for a corresponding function, so we can choose which one to use in those cases.

This article provides an overview of the six list operators available in DuckDB, along with basic examples to demonstrate their usage.

Read more

Convert a Table to a JSON Document with JSON_GROUP_OBJECT() in DuckDB

In DuckDB, the json_group_object() function is a convenient way to aggregate data into JSON objects by pairing keys and values across rows within groups.

The function is especially useful when we’re transforming tabular data into a more hierarchical or nested JSON structure for web APIs, reporting, or downstream processing. It helps pivot rows into a single JSON object, making the data more compact and easier to consume in applications that require JSON formats.

Read more

2 Ways to Get the Month Name from a Date in DuckDB

DuckDB offers a pretty good range of functions that enable us to get date parts from date or timestamp value. For example, we can extract the month part from a given date value. In most cases, this will be the month number, for example 08 or just 8.

But sometimes we might want to get the actual month name, like October for example. And other times we might just want the abbreviated month name, like Oct.

Fortunately, DuckDB’s got our back. Here are two ways to return the month name from a date or timestamp value in DuckDB.

Read more