DTSLogEntryFrequency 枚举
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
提供用于帮助进行日志规划的信息。 您应选取与您要在任务中生成特定日志条目的频率最密切对应的提示信息。 包的用户要设置日志条目筛选时,此枚举属性可以帮助他们。 用户可以查看此属性,预先知道是否会出现大量特定类型的条目并进行相应地规划。
public enum class DTSLogEntryFrequency
public enum DTSLogEntryFrequency
type DTSLogEntryFrequency =
Public Enum DTSLogEntryFrequency
- 继承
-
DTSLogEntryFrequency
字段
Consistent | 1 | 记录条目的次数保持不变,与工作负荷不成比例。 例如,在任务的开始和结束时创建日志。 |
Occasional | 0 | 有时记录该条目,通常是在特殊情况下。 |
Proportional | 2 | 记录条目的次数与工作负荷成比例。 |
示例
下面的代码示例循环访问 LogEntryInfos 集合,然后打印每个 LogEntryInfo 找到的属性,包括 FrequencyHint从此枚举返回值。 代码示例演示如何设置 FrequencyHint 属性是只读的。
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
namespace LogEntryInfosTest
{
class Program
{
static void Main(string[] args)
{
// The package is one of the SSIS Samples.
string mySample = @"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx";
Application app = new Application();
Package pkg = app.LoadPackage(mySample, null);
LogEntryInfos logInfos = pkg.LogEntryInfos;
Console.WriteLine("Number of log entries: {0}", logInfos.Count.ToString());
foreach (LogEntryInfo logInfo in logInfos)
{
Console.WriteLine("CreationName: {0}", logInfo.CreationName);
Console.WriteLine("Description: {0}", logInfo.Description);
Console.WriteLine("FrequencyHint: {0}", logInfo.FrequencyHint);
Console.WriteLine("ID: {0}", logInfo.ID);
Console.WriteLine("Name: {0}", logInfo.Name);
}
}
}
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
Namespace LogEnTryInfosTest
Class Program
Shared Sub Main(ByVal args() As String)
' The package is one of the SSIS Samples.
Dim mySample As String = "C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx"
Dim app As Application = New Application()
Dim pkg As Package = app.LoadPackage(mySample,Nothing)
Dim logInfos As LogEnTryInfos = pkg.LogEnTryInfos
Console.WriteLine("Number of log entries: {0}", logInfos.Count.ToString())
Dim logInfo As LogEnTryInfo
For Each logInfo In logInfos
Console.WriteLine("CreationName: {0}", logInfo.CreationName)
Console.WriteLine("Description: {0}", logInfo.Description)
Console.WriteLine("FrequencyHint: {0}", logInfo.FrequencyHint)
Console.WriteLine("ID: {0}", logInfo.ID)
Console.WriteLine("Name: {0}", logInfo.Name)
Next
End Sub
End Class
End Namespace
示例输出:
日志条目数:1
CreationName:
说明:日志包诊断信息,例如最大并发可执行文件
FrequencyHint:一致
ID: {65F44252-EB0C-4CCB-ADE4-BA4AB86B4CF9}
名称:诊断