Find-DbaView

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

This function can either run against specific databases or all databases searching all user or user and system views.

Screenshots

dbatools - Find-DbaView

Examples

Searches all user databases views for “whatever” in the text body

Find-DbaView -SqlInstance DEV01 -Pattern whatever

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

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

Searches in “MyDB” database views for “some string” in the text body

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

Searches in “MyDB” database views for “runtime” in the textbody

Find-DbaView -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.