Triggers

Tag: triggers

How to Trace Trigger Executions with Query Store and Extended Events

How to Trace Trigger Executions with Query Store and Extended Events

Triggers can be tricky to observe in SQL Server. When you need to understand exactly what a trigger is doing and what it impacts, Query Store and Extended Events both have something to offer, but using them effectively requires navigating some confusing nuances. Query Store tracks query-level executions aggregated by query_id, but has a habit of generating a lot of query_ids with different context settings for triggers. Extended Events can capture trigger module starts and individual statement completions within triggers.

This post walks through setting up both observation methods on a test trigger, then compares what each one shows. You’ll see how Query Store data gets spread across multiple query_ids and context_settings_id values, a variety of ways to trace triggers in XEvents, and why the numbers don’t always match up exactly between traces and Query Store.

Continue reading

Azure DevOps: How to Set a Custom Release Branch Folder Filter in Build Pipeline Triggers (Video)

Azure DevOps: How to Set a Custom Release Branch Folder Filter in Build Pipeline Triggers (Video)

This is the first in a series of posts about simple things that I had a hard time figuring out in Azure DevOps services.

It can be very useful to enable Continuous Integration for multiple folders in your DevOps pipeline: say, for every branch created under releases/ or features/. But configuring this can be strangely confusing!

Continue reading

Why I Love DML Triggers in SQL Server

Why I Love DML Triggers in SQL Server

It’s TSQL Tuesday! If you’re not familiar, TSQL Tuesday is a monthly blogging event where a Microsoft Data Platform community member chooses a writing prompt. This is a great thing if you’re interested in starting a technical blog and wonder, “What would I write about?” It’s also great if, like me, you occasionally want a little outside inspiration to shake things up.

This month’s topic is from Steve Jones: we’re invited to write about an experience that we’ve had with triggers.

Continue reading