HasInsteadOfTrigger 속성

테이블에 instead of 트리거가 있는지 여부를 지정하는 Boolean 속성 값을 가져옵니다.

네임스페이스:  Microsoft.SqlServer.Management.Smo
어셈블리:  Microsoft.SqlServer.Smo(Microsoft.SqlServer.Smo.dll)

구문

‘선언
<SfcPropertyAttribute(SfcPropertyFlags.None Or SfcPropertyFlags.Standalone Or SfcPropertyFlags.SqlAzureDatabase)> _
Public ReadOnly Property HasInsteadOfTrigger As Boolean
    Get
‘사용 방법
Dim instance As Table
Dim value As Boolean

value = instance.HasInsteadOfTrigger
[SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase)]
public bool HasInsteadOfTrigger { get; }
[SfcPropertyAttribute(SfcPropertyFlags::None|SfcPropertyFlags::Standalone|SfcPropertyFlags::SqlAzureDatabase)]
public:
property bool HasInsteadOfTrigger {
    bool get ();
}
[<SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase)>]
member HasInsteadOfTrigger : bool
function get HasInsteadOfTrigger () : boolean

속성 값

유형: System. . :: . .Boolean
테이블에 Instead of 트리거가 정의되어 있는지 여부를 지정하는 Boolean 값입니다.
True 이면 테이블의 트리거 중 하나 이상이 Instead of 트리거로 정의되어 있고, 그렇지 않으면 False(기본값)입니다.

주의

An "instead of" trigger runs instead of the triggering statement.

The following code example shows how to list each table in the AdventureWorks2008R2 database with an instead of trigger.

C#

Server srv = new Server("(local)");
Database db = srv.Databases["AdventureWorks2008R2"];

foreach (Table tb in db.Tables) 
{
    if (tb.HasInsteadOfTrigger == true)
   {
      Console.WriteLine("The " + tb.Name + " table has an instead of trigger");
   }
}

Powershell

$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$db = New-Object Microsoft.SqlServer.Management.Smo.Database
$db = $srv.Databases.Item("AdventureWorks2008R2")

Foreach ($tb in $db.Tables) 
{
   If ($tb.HasInsteadOfTrigger -eq $TRUE)
   {
      Write-Host "The" $tb.Name "table has an instead of trigger."
   }
}