In this series, I look at strategies for archiving data and how it can impact your entire infrastructure.
SQL Server
For October's T-SQL Tuesday, Steve Jones asks us to talk about ways we've used dynamic SQL to solve problems.
In this tip, I show how to simplify calculations involving nth weekday or non-weekday, with and without a calendar table.
For this month's T-SQL Tuesday, I talk about a not-quite-yet-announced feature in SQL Server 2022 that has the potential to function as a low-effort bad habit logger.
I talk about ways to use wrapper functions to work around tedious syntax required by the new function, GENERATE_SERIES.
On the 10th anniversary of SQLPerformance.com, I look back on my favorite posts – one from each year.
For this month's T-SQL Tuesday, Deb Melkin asks us get up on our favorite soapbox. I have so many, but this time I picked a new one…
Logging tables get huge, and date range queries get more if they don't use the clustered index. Here's one way I've addressed the issue.
Using a fictitious future timeline, I explain how CUs and GDRs differ and why build number alone might not tell the whole story.
In this tip, I show some real-life reasons why you may not want to create all the partitions you'll ever need up front.
I talk about why I prefer CONVERT over CAST to be consistent. Basically, if you sometimes HAVE to use only one, why not just ALWAYS use that one?
There are often multiple ways to express a query and get the same results, often without any change in performance. Learn about one example.
In this tip, I talk about the compatibility between major versions and SQL Server's internal database version.
I continue looking at some of the changes in SQL Server 2022 that aren't on the marketing slides.
I warn about a cumbersome change to setup, where something is checked by default when it shouldn't be.
The first public preview of SQL Server 2022 is here! Read about my favorite T-SQL enhancements.
Today I received a mind-blowing award for my 200th tip at MSSQLTips.com.
In 2015, I wrote about a stored procedure to find strings within all tables across all user databases. In this follow-up tip, I enhance the procedure to optionally include views and search within specific databases.
I show how to piece together portions of SQL Server metadata to generate DBML (which is more useful than it sounds).
I wrote two tips around what you can do when a table that stores the same strings over and over again has grown to an unmanageable size: create a dimension table!
I talk about why every CTE I write starts with a semi-colon, and why you won't change my mind about it.
A recent documentation update raises questions about the love-it-or-hate-it READ UNCOMMITTED isolation level.
In this tip, I show how I combine GROUPING SETS and PIVOT to get crosstab-style reports without Excel.
In the second part of this series, I show two ways to shift expensive computations to write time.
I talk about progress in aggregating strings – both in the functionality offered by SQL Server and the quality of my own code samples.
In this tip I confirm that FORMAT is still a dog compared to even very complex expressions using CONCAT_WS, DATENAME, DATEPART, and CONVERT.
I was honored to be a guest on the most recent Mixed Extents podcast, along with my friend and colleague Andy Mallon, where we talked about patching SQL Server.
I harassed Erik Ejlskov Jensen enough to make a universal command-line version of SqlQueryStress. See how I set up a performance test between Intel and M1 MacBooks.
In this tip, I show how indirect checkpoints can help improve performance and stability, and conclude that you should proactively change this setting everywhere.
I show how I set up Azure SQL Edge in a Docker container on the new M1 MacBook.
See one way to use a queue table to spread out spiky, ad hoc deletes from a clustered columnstore index.
There have been many evolutions of how Microsoft accepts feedback about SQL Server.
These functions aren't brand new, but they're in Azure SQL Database and Azure SQL Managed Instance, and they're coming to SQL Server 2022 soon.
See the new overloaded STRING_SPLIT() function with its enable_ordinal parameter, now available in an Azure SQL Database near you.
In this tip, I show how I compared my previous favorite ordered splitting function to a different technique using OPENJSON().
I show one way to run arbitrary SQL against objects in an arbitrary database – using nested dynamic SQL.
Using PowerShell calling nested dynamic SQL that drives a cursor, I show one way to collect information about queries with index hints both in the plan cache and in stored procedures, views, and other modules.
After seeing multiple people switch from STRING_SPLIT() to OPENJSON() to deal with multiple parameters, I decided to explore whether that is a change in the wrong direction.
I talk about NULLs in SQL Server, the logical issues with avoiding them, and potential performance impacts.
Updated this stored procedure I wrote a decade ago to search for a string in procedure bodies, object names, job steps, and more…
I talk a bit about bit columns: names with negative context, allowing NULLs, and using cryptic BITWISE operators instead of readable, self-documenting expressions.
For this month's T-SQL Tuesday, I talk about the scripts I use to keep a local system with all kinds of oddball metadata scenarios.
In this tip, I use specific examples to counter assumptions that data types are always case insensitive.
I talk about using partition switching to load in fresh versions of staging tables with the least impact to users.
I made some landing pages here, with simple and easy-to-remember URLs, presenting sets of links to very frequently-discussed topics around SQL Server.
In this tip, I discuss one way to help avoid infinite loops in common while loop patterns.
In part 4, I show how to include ad hoc DML queries in the analysis.
In part 3, I tie it together and show how to use relational logic to further eliminate false positives.