Thor Logo dbatools

Trigger

Find-DbaTrigger

Claudio Silva (@ClaudioESSilva)

Find-DbaTrigger View Source Claudio Silva (@ClaudioESSilva) Windows, Linux, macOS Synopsis Searches trigger code across server, database, and object levels for specific text patterns or regex matches. Description Searches through SQL Server trigger definitions to find specific text patterns, supporting both literal strings and regular expressions. Examines triggers at three levels: server-level triggers, database-level DDL triggers, and object-level DML triggers on tables and views. This is particularly useful when you need to find triggers that reference specific objects before making schema changes, locate hardcoded values that need updating, or audit trigger code for compliance requirements.

Read more

Get-DbaDbObjectTrigger

Claudio Silva (@claudioessilva), claudioessilva.eu

Get-DbaDbObjectTrigger View Source Claudio Silva (@claudioessilva), claudioessilva.eu Windows, Linux, macOS Synopsis Retrieves triggers attached to tables and views across SQL Server databases. Description Retrieves all DML triggers that are attached to tables and views within specified databases. This function helps DBAs inventory trigger-based business logic, identify potential performance bottlenecks, and document database dependencies. You can filter results by database, object type (tables vs views), or pipe in specific objects from Get-DbaDbTable and Get-DbaDbView.

Read more

Get-DbaDbTrigger

Chrissy LeMaire (@cl), netnerds.net

Get-DbaDbTrigger View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Retrieves database-level DDL triggers from SQL Server instances for security auditing and change tracking analysis. Description Retrieves all database-level DDL triggers from one or more SQL Server instances. Database triggers fire in response to DDL events like CREATE, ALTER, or DROP statements within a specific database, making them useful for change auditing and security monitoring. This function helps DBAs inventory these triggers for compliance reporting, troubleshooting performance issues, or documenting automated database change tracking mechanisms.

Read more

Get-DbaInstanceTrigger

Chrissy LeMaire (@cl), netnerds.net

Get-DbaInstanceTrigger View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Retrieves server-level DDL triggers from SQL Server instances for auditing and documentation Description Returns server-level DDL triggers that monitor and respond to instance-wide events like CREATE, ALTER, and DROP statements. Server triggers are commonly used for security auditing, change tracking, and preventing unauthorized schema modifications across all databases on an instance. This function helps identify what automated responses are configured at the server level, which is essential for troubleshooting unexpected DDL blocking and documenting compliance controls.

Read more

Get-DbaModule

Brandon Abshire, netnerds.net

Get-DbaModule View Source Brandon Abshire, netnerds.net Windows, Linux, macOS Synopsis Retrieves database modules (stored procedures, functions, views, triggers) modified after a specified date Description Queries sys.sql_modules and sys.objects to find database modules that have been modified within a specified timeframe, helping DBAs track recent code changes for troubleshooting, auditing, or deployment verification. Essential for identifying which stored procedures, functions, views, or triggers were altered during maintenance windows or after application deployments.

Read more