다음을 통해 공유


Audit.QueueDelay 속성

Gets or sets the amount of time in milliseconds that can elapse before audit actions are processed.

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

구문

‘선언
<SfcPropertyAttribute(SfcPropertyFlags.Standalone)> _
Public Property QueueDelay As Integer 
    Get 
    Set
‘사용 방법
Dim instance As Audit 
Dim value As Integer 

value = instance.QueueDelay

instance.QueueDelay = value
[SfcPropertyAttribute(SfcPropertyFlags.Standalone)]
public int QueueDelay { get; set; }
[SfcPropertyAttribute(SfcPropertyFlags::Standalone)]
public:
property int QueueDelay {
    int get ();
    void set (int value);
}
[<SfcPropertyAttribute(SfcPropertyFlags.Standalone)>]
member QueueDelay : int with get, set
function get QueueDelay () : int 
function set QueueDelay (value : int)

속성 값

유형: System.Int32
A Int32 value that specifies the number of milliseconds that can elapse before audit actions are processed.

주의

The default value, 1000 (1 second), is the minimum value that can be set. The maximum value that can be set is 2,147,483,647 milliseconds, which is equivalent to 24 days, 20 hours, 31 minutes, 23.647 seconds. The value 0 indicates synchronous delivery.

The following code example demonstrates how to set the queue delay to 5000 milliseconds.

C#

using System;
using Microsoft.SqlServer.Management.Smo;

namespace samples
{
    class Program
    {
        static void Main(string[] args)
        {
            //Create the audit and set the queue delay
            Server dbServer = new Server("(local)");
            Audit dbAudit = new Audit(dbServer, "Test Audit");
            dbAudit.DestinationType = AuditDestinationType.File;
            dbAudit.FilePath = "C:\\AuditDirectory";
            dbAudit.QueueDelay = 5000;
            dbAudit.Create();
        }
    }
}

Powershell

#Create the audit and set the queue delay
$dbServer = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$dbAudit = New-Object Microsoft.SqlServer.Management.Smo.Audit($dbServer, "Test Audit")
$dbAudit.DestinationType = [Microsoft.SqlServer.Management.Smo.AuditDestinationType]'File'
$dbAudit.FilePath = "C:\AuditDirectory"
$dbAudit.QueueDelay = 5000
$dbAudit.Create()

참고 항목

참조

Audit 클래스

Microsoft.SqlServer.Management.Smo 네임스페이스