Get-SqlTrigger

Gets an SMO Trigger object.

Syntax

Get-SqlTrigger [-smo] <Object> [[-name] <String>] [<CommonParameters>]

Detailed Description

The Get-SqlTrigger function gets a collection of SMO Trigger objects for the specified smo object.

Related Commands

* Get-SqlTrigger

Parameters

Name Description Required? Pipeline Input Default Value
smo    true  true (ByValue)   
name    false  false   

Input Type

Microsoft.SqlServer.Management.Smo.Database or Microsoft.SqlServer.Management.Smo.Server or Microsoft.SqlServer.Management.Smo.Table or Microsoft.SqlServer.Management.Smo.View You can pipe SMO objects to Get-SqlTrigger

Return Values

Microsoft.SqlServer.Management.Smo.Trigger or Microsoft.SqlServer.Management.Smo.DatabaseDdlTrigger or Microsoft.SqlServer.Management.Smo.ServerDdlTrigger Get-SqlTrigger returns a Microsoft.SqlServer.Management.Smo.Trigger/DatabaseDdlTrigger/ServerDdlTrigger object.

Notes

Additional properties including the database, server and extended properties are included in the output. The output type depends on whether a server, database or table/view object is passed to the smo parameter.

Examples

EXAMPLE 1

Get-SqlDatabase "Z002\sql2K8" "pubs" | Get-SqlTrigger -name tr_MStran_alterview
This command gets the SMO database Trigger, tr_MStran_alterview for SQL Server Z002\SQL2K8, AdventureWorks database.

EXAMPLE 2

Get-SqlDatabase "Z002\sql2K8" pubs | Get-SqlTable | Get-SqlTrigger
This command gets a collection of SMO Trigger objects for all user tables in the pubs database.