Whether you are a long-time Mac user or recently transitioned from Windows, running SQL Server on macOS brings a unique set of challenges. Most tutorials assume you’re on Windows using SQL Server Management Studio (SSMS), which is a tool that doesn’t exist for Mac. Instead, you’re likely running SQL Server inside a Docker container and using a tool like VS Code.
mssql
Monitoring Query Store Storage Usage in SQL Server (T-SQL)
When you have Query Store enabled in SQL Server, it consumes disk space in order to store query text, execution plans, and runtime statistics. Monitoring storage usage can help you avoid situations where Query Store fills up and stops capturing data or switches to read-only mode.
How to View Query Execution History Over Time in SQL Server
In SQL Server, Query Store aggregates performance statistics into time intervals, allowing you to see how query performance changes over time. This historical view helps you identify when performance degraded, spot patterns like daily or hourly spikes, and correlate performance changes with deployments or data changes.
This assumes that Query Store is enabled on the database in question. So assuming Query Store is enabled on the database, you can use the following queries to check the execution history of queries over time.
What is a Missing Index in SQL Server?
SQL Server has a concept of “missing indexes”. And no, it’s not referring to an index that used to be there but has now disappeared. Rather, the missing index concept is designed to help us improve the performance of our database.
A missing index is an index that doesn’t yet exist on your table but probably should. SQL Server actually tracks queries that would benefit from indexes and stores suggestions in a set of dynamic management views (DMVs) called the missing index DMVs.
When you run a query and the optimizer thinks that this would be way faster with an index on those columns, it logs that suggestion. Over time, these suggestions accumulate, giving you a prioritized list of indexes that could improve your database’s performance.
How to Install SQL Server on a Mac in 2026
Running a full-featured Microsoft SQL Server on a Mac used to be a headache, but as of 2026, it is smoother than ever. Thanks to improvements in Docker Desktop and macOS’s Rosetta 2 translation, you can now run the enterprise-grade engine (including the new SQL Server 2025 Preview) directly on your M1, M2, M3, or M4 Mac.
This guide will walk you through setting up a modern SQL Server environment from scratch.
How to View All Queries in Query Store in SQL Server
SQL Server’s Query Store captures all executed queries (or a subset based on your capture mode) along with their execution statistics. Viewing the complete list of captured queries helps you understand what’s been tracked and provides a starting point for performance analysis.
Using DATEDIFF() with LEAD() to Calculate Time Until Future Events
When you’re analyzing how events unfold over time in a SQL database, one of the biggest challenges can be efficiently comparing what’s happening now to what comes next. Each event typically appears as its own row with a timestamp, but meaningful insight often comes from understanding how those timestamps relate to one another. Fortunately SQL Server provides some useful tools for this kind of sequential analysis.
Rather than relying on bulky self-joins or multi-step logic, SQL window functions offer a streamlined way to track these transitions. For example, by pairing the LEAD() function with DATEDIFF(), you can instantly measure the gap between consecutive events and surface insights that would otherwise require far more complex queries.
How to Unforce a Query Execution Plan in SQL Server
When you’ve forced an execution plan in SQL Server’s query store and later want to allow the optimizer to choose plans freely again, you’ll need to unforce the plan. You might want to do this because you’ve fixed the underlying issue or the forced plan is no longer optimal. Whatever the reason, the solution is straightforward and easy.
Generating Staggered Dates with SQL Server Window Functions
SQL Server’s window functions open up some creative possibilities when you need to work with dates. One interesting pattern involves pairing DATEADD() with ROW_NUMBER() to automatically generate sequential dates based on your query results.
This technique gives you a flexible way to calculate dates dynamically without hardcoding values or maintaining separate date tables. This can be useful for doing things like building a scheduling system, creating test data with realistic timestamps, or just spacing events across a timeline.
Understanding Locks in SQL Server
If you’ve ever wondered why your database queries sometimes seem to wait around doing nothing, or why two users can’t update the same record at the exact same moment, you’re dealing with locks. In SQL Server, locks are the fundamental mechanism that keeps your data consistent and prevents the chaos that would ensue if everyone could modify everything simultaneously.