문서를 영문으로 보려면 영문 확인란을 선택하세요. 마우스 포인터를 텍스트 위로 이동시켜 팝업 창에서 영문 텍스트를 표시할 수도 있습니다.
번역
영문

Table.HasDeleteTrigger 속성

Gets the Boolean property value that specifies whether the table has a delete trigger.

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

[SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase)]
public bool HasDeleteTrigger { get; }

속성 값

유형: System.Boolean
A Boolean value that specifies whether there are any delete triggers defined on the table.If True, there is a delete trigger defined on the table. Otherwise, False (default).

A delete trigger executes when a row of data is deleted.

The following code example shows how to check each table in the AdventureWorks2012 database to see if it has a delete trigger.

C#

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

Foreach (Table tb in db.Tables) 
{
   Console.WriteLine("The " + tb.Name + " table has a delete trigger:" + tb.HasDeleteTrigger.ToString());
}

Powershell

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

Foreach ($tb in $db.Tables) 
{
   Write-Host "The" $tb.Name "table has a delete trigger:" $tb.HasDeleteTrigger
}

커뮤니티 추가 항목

추가
표시: