KDA: Echoes of Deception - Case 5
A deleted podcast episode, 17 million archive log entries, and KQL's time series analysis to find the backup that was never supposed to survive.
A deleted podcast episode, 17 million archive log entries, and KQL's time series analysis to find the backup that was never supposed to survive.
Someone hacked Digitown's municipality and stole classified documents. 45 million rows of router traffic, an IP lookup table, and KQL's anomaly detection to find who did it.
I trusted AI to redesign this blog, be my personal assistant, and organize my life. But I won't let it near a production database. Here's why that's not a contradiction - and what I learned about trust along the way.
What does SQL Server actually see when it parses your code? I built a free web tool that lets you paste TSQL and explore the abstract syntax tree - click a token, see the node, read the fragment.
20 stolen cars with swapped license plates - using KQL to trace VIN changes through traffic data and find the common storage location.
Digitown's citizens are being targeted by phishing calls. Using KQL, I analyze call patterns - duration, hidden caller IDs, and disconnect behavior - to unmask the phisher.
Digitown's utility bills doubled overnight. Using KQL and the EXPLAIN feature, I dig through billing data to find duplicate charges and negative consumption.
A walkthrough of the Kusto Detective Agency UI and the onboarding challenge - finding which detective earned the most bounty money in 2022.
I have a soft spot for Kusto. This series walks through the Kusto Detective Agency challenges - data mysteries you solve with KQL instead of a magnifying glass.
A utility script for deploying schema changes without a maintenance window - using a time-based loop, lock checking, and GOTO to minimize blocking on busy SQL Servers.
A rant about fn_xe_file_target_read_file - the nvarchar(max) return type, broken time filtering, and the circular dependency for finding rollover files.
Your stored procedure calls another procedure, which calls a view. How deep does it go? Here's a recursive CTE that traces the full dependency chain, including cross-database references.
A crash course on database CI/CD: source control as the source of truth, state-based vs migration-based versioning, and the many moving parts of automated database deployments.
I was paged for a blocking chain where the lead blocker had a transaction name I'd never seen: CSbRollbackHandlerTask::DisableQ. Here is how I reproduced it and why the blocked process report refuses to help.
My SSMS setup guide: layout tweaks, essential Options settings, hotkeys I can't live without, and miscellaneous tips for a better SQL Server Management Studio experience.
An index rebuild quietly blocked an async stats update, and the whole server started timing out. Here is the lock-partitioning repro and the SQL Server 2022 fix.
Does ALTER INDEX REBUILD with WAIT_AT_LOW_PRIORITY log its victims in the error log the same way KILL does? Let's find out.
Grant Fritchey asked us to talk about our favourite SQL Server tool for T-SQL Tuesday #166. Mine is Extended Events - and I have the GitHub repo and a public speaking session to prove it.
Read a cautionary tale on how I've deceived the SSMS, then promptly forgot about it and, in turn, ultimately confused myself.
This December I'm solving Advent of Code in two languages at once - SQL and KQL. Here's where I'm posting the code and how far I think I'll get.
Create an Extended Events session with just a filename and the .xel file lands somewhere - but where? Here's what the default path is and how to change it.
Fifteen SQL bloggers answered one question: what turns ordinary code into production code? Here's what they taught me.
I picked the T-SQL Tuesday topic and still struggled to answer it. The quality of production code I value most: it has tests.
I'm hosting T-SQL Tuesday this November. The question: which secret ingredient turns ordinary code into production-grade code?
You've learned why Scalar UDFs are slow and how to remove them. The last question: where do you even start? Here's how I triage them across a whole environment.
Another productivity tool in my toolbox that I use daily. This time it's about file search. Everything will help you find... well, everything.
Here are the chronicles of my struggles to add a large Clustered index to a View without causing an outage.
Print Screen and Paint never cut it for me. Greenshot did: precise region capture, a real annotation editor, obfuscation, and one-key sharing. Here's the tour.
Nuke them from orbit, or inline them. The practical ways to neutralize Scalar UDF performance pain, from a free SCHEMABINDING win to a full ITVF rewrite.
My T-SQL Tuesday rant: an app that connects as '.Net SqlClient Data Provider' turns debugging into a manhunt. Please, name your apps.
A Scalar function that does literally nothing still runs over 20 times slower. Here is the proof, measured four different ways.
You fix an untrusted constraint, and by morning it's back to untrusted. Here's how to catch the process responsible, using Extended Events.
Consultants hate me for this one weird trick. Because I'll be uncovering all the mess Scalar functions can cause in a series of articles.
My T-SQL Tuesday #151 entry: the SQL habits I swear by, and the ones I'd ban from every codebase if I could.
SQL Server 2022's CTP has dropped. I diffed its Extended Events against 2019 and pulled out the few new ones worth a look.
My daughter's LEGO game makes you re-enter every cheat on a clunky six-dial lock. So I built a TSQL solver to find the shortest path through all of them.
I keep relearning how to set up secure cross-database access, so here's the reminder: a diagram plus a full follow-along example you can run yourself.
Semicolons, leading commas, single-letter aliases. Here is the SQL style everyone loves to argue about, and the practical reasons I refuse to budge.
Ever struggled to match the binary hash from DMVs and Query Store against the numeric one in Extended Events? Let's fix that for good.
Ever wondered what the KEEP PLAN hint actually does? The docs are vague, so I tested it against every recompilation threshold to find out.
Open an XE event file in SSMS and the timestamps stare back at you. Local time or server time? I spun up a container in another timezone to find out.
My first in-person conference, my first time speaking, and a costume that needed a face mask. A SQLBits 2022 recap told in Lord of the Rings quotes.
Last time we cheated. This time we actually play: a set-based scoring engine in TSQL, duplicate letters and all.
Your Twitter feed is probably already full of Wordle posts, so why not one more? Let's start the series the lazy way: by cheating.
How can 15 be less than 13? A perfect storm of bad assumptions about sql_variant comparison rules.
A colleague needed to find who was changing a specific cell in a busy table. SQL Audit was too noisy, Query Store too vague. I found a way to combine triggers with Extended Events for surgical precision.
I found an IS lock in a deadlock report on an RCSI database. That shouldn't be possible. Here's what caused it.
Sometimes the fastest help is the kind you find yourself. A rundown of the lazy question patterns I keep seeing in SQL help channels.
This month's T-SQL Tuesday invitation is from John McCormack. I'm sharing a few handy snippets I use on a regular basis - a time loop, impersonation testing, database recreation, and some RegEx for SSMS Find & Replace.
One query against sys.messages can reveal every edge case SQL Server knows about before you commit to a new design.
Query Store comes with default settings - but are they what the documentation says? Let's find out using a simple Extended Events session.
Production errors are hard to reproduce. Here's my go-to Extended Events session that captures errors with their full TSQL calling stack.
WordPress was making me hate blogging. Moving to Hugo, GitHub, and Azure Static Web Apps fixed that.
Work-life balance has been my focus for the past year and I've already made some changes to my lifestyle. Now it's time to take a look back and evaluate.
It took three tries before containers clicked for me. Each time I learned a bit more, but it wasn't until I had my own project that it all came together.
Brent Ozar asked the SQL community about their favourite data type. My answer surprised even me - sql_variant. Here's why, plus the data type I can't stand.
My impressions right after taking an online proctored exam. There were a couple of problems I ran into. Hopefully, this article will help you prepare.
Believe it or not, there is a wrong and correct way when it comes to generating XML documents in SQL.