次の方法で共有


CategoryID プロパティ

ジョブ カテゴリを一意に識別する ID 値を取得します。

名前空間:  Microsoft.SqlServer.Management.Smo.Agent
アセンブリ:  Microsoft.SqlServer.Smo (Microsoft.SqlServer.Smo.dll)

構文

'宣言
<SfcKeyAttribute()> _
<SfcPropertyAttribute(SfcPropertyFlags.Standalone)> _
Public ReadOnly Property CategoryID As Integer
    Get
'使用
Dim instance As Job
Dim value As Integer

value = instance.CategoryID
[SfcKeyAttribute()]
[SfcPropertyAttribute(SfcPropertyFlags.Standalone)]
public int CategoryID { get; }
[SfcKeyAttribute()]
[SfcPropertyAttribute(SfcPropertyFlags::Standalone)]
public:
property int CategoryID {
    int get ();
}
[<SfcKeyAttribute()>]
[<SfcPropertyAttribute(SfcPropertyFlags.Standalone)>]
member CategoryID : int
function get CategoryID () : int

プロパティ値

型: System. . :: . .Int32
ジョブ カテゴリの ID 値を示す In32 値です。

説明

ジョブが属するカテゴリを参照する ID 値です。カテゴリは、JobCategory オブジェクトを使用して定義できます。

使用例

次のコード例では、ジョブがカテゴリ 1 に属することを指定します。

C#

Job jb = new Job();
jb.CategoryID = 1;

PowerShell

$jb = new-object Microsoft.SqlServer.Management.Smo.Agent.Job
$jb.CategoryID = 1