Поделиться через


Свойство 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