共用方式為


DatabaseDdlTrigger.ExecutionContextUser 屬性

Gets or sets the database user that is the context used when the database DDL trigger executes.

此 API 不符合 CLS 標準。 

命名空間:  Microsoft.SqlServer.Management.Smo
組件:  Microsoft.SqlServer.Smo (在 Microsoft.SqlServer.Smo.dll 中)

語法

'宣告
<SfcReferenceAttribute(GetType(User), "Server[@Name = '{0}']/Database[@Name = '{1}']/User[@Name = '{2}']",  _
    )> _
<CLSCompliantAttribute(False)> _
<SfcPropertyAttribute(SfcPropertyFlags.None Or SfcPropertyFlags.Standalone Or SfcPropertyFlags.SqlAzureDatabase)> _
Public Property ExecutionContextUser As String 
    Get 
    Set
'用途
Dim instance As DatabaseDdlTrigger 
Dim value As String 

value = instance.ExecutionContextUser

instance.ExecutionContextUser = value
[SfcReferenceAttribute(typeof(User), "Server[@Name = '{0}']/Database[@Name = '{1}']/User[@Name = '{2}']", 
    )]
[CLSCompliantAttribute(false)]
[SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase)]
public string ExecutionContextUser { get; set; }
[SfcReferenceAttribute(typeof(User), L"Server[@Name = '{0}']/Database[@Name = '{1}']/User[@Name = '{2}']", 
    )]
[CLSCompliantAttribute(false)]
[SfcPropertyAttribute(SfcPropertyFlags::None|SfcPropertyFlags::Standalone|SfcPropertyFlags::SqlAzureDatabase)]
public:
property String^ ExecutionContextUser {
    String^ get ();
    void set (String^ value);
}
[<SfcReferenceAttribute(typeof(User), "Server[@Name = '{0}']/Database[@Name = '{1}']/User[@Name = '{2}']", 
    )>]
[<CLSCompliantAttribute(false)>]
[<SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase)>]
member ExecutionContextUser : string with get, set
function get ExecutionContextUser () : String 
function set ExecutionContextUser (value : String)

屬性值

型別:System.String
A String value that specifies the database user that is the context used when the database DDL trigger executes.

備註

This property is required only when the ExecutionContext property is set to ExecuteAsUser.

範例

設定屬性

請參閱

參考

DatabaseDdlTrigger 類別

Microsoft.SqlServer.Management.Smo 命名空間

其他資源

建立、改變和移除觸發程式

DDL 觸發程序

CREATE TRIGGER (Transact-SQL)