Find-DbaTrigger

Returns all triggers that contain a specific case-insensitive string or regex pattern.

This function search on Instance, Database and Object level.
If you specify one or more databases, search on Server level will not be preformed.

Screenshots

dbatools - Find-DbaTrigger

Examples

Searches all user databases triggers for “whatever” in the textbody

Find-DbaTrigger -SqlInstance DEV01 -Pattern whatever

Searches all databases for all triggers that contain a valid email pattern in the textbody

Find-DbaTrigger -SqlInstance sql2016 -Pattern ‘\[email protected]\w+.\w+’

Searches in “mydb” database triggers for “some string” in the textbody

Find-DbaTrigger -SqlInstance DEV01 -Database MyDB -Pattern ‘some string’ -Verbose

Searches in “mydb” database triggers for “runtime” in the textbody

Find-DbaTrigger -SqlInstance sql2016 -Database MyDB -Pattern RUNTIME -IncludeSystemObjects

Author

This command was created by Cláudio Silva. You can find Cláudio on Twitter and his blog.