ApexSQL.Log.Api Send comments on this topic.
DmlFilter Class
See Also  Members   Example 



Structure holding values for DML filtering.

Object Model


Syntax

Visual Basic (Declaration) 
Public NotInheritable Class DmlFilter 
Visual Basic (Usage)Copy Code
Dim instance As DmlFilter
C# 
public sealed class DmlFilter 
C++/CLI 
public ref class DmlFilter sealed 

Example

Creating DmlFilter
C#Copy Code
static DmlFilter GetDemoFilter()
{
    DmlFilter filter = 
new DmlFilter();

    
//  Audit just 50 first operations that match the filter.
    filter.noRequestedOperations = 
50;
    
//  Show only committed transactions.
    List<TransactionState> transactionStates = 
new List<TransactionState>();
    transactionStates.Add(TransactionState.Committed);
    filter.transactionStates = transactionStates.ToArray();
    
// get transactions form the ApexSQL Log Demo application
    filter.applications = 
new string[] {"ApexSQL Log Demo" };
    filter.applyHistoricReconstruction = 
true;
    
// from all hosts
    filter.clientHosts = 
null;
    
// with all descriptions
    filter.descriptions = 
null;
    
// begin from 8/10/2007
    filter.from = 
new DateTime(2007810);
    
// all
    filter.minimumDuration = 
0;
    
// get only deleted rows
    filter.operations = 
new DmlOperationType[] { DmlOperationType.Delete };
    
// don't audit Allocate Root transactions
    filter.passAllocateRootTransactions = 
false;
    
// skip the ApexSQL Log tables
    filter.passApexSqlLogApplicationTables = 
false;
    
// skip invalid rows
    filter.passInvalidRows = 
false;
    
// skip Move Index Page transactions
    filter.passMoveIndexPageTransactions = 
false;
    
// skip Shrink File transactions
    filter.passShrinkFileTransactions = 
false;
    
// skip Split Next Root transactions
    filter.passSplitNextTransactions = 
false;
    
// skip Split Next transactions
    filter.passSplitTransactions = 
false;
    
// skip system tables
    filter.passSystemTables = 
false;
    
// pass unknown applications
    filter.passUnknownApplications = 
true;
    
// pass unknown client hosts
    filter.passUnknownClientHosts = 
true;
    
// pass unknown tables
    filter.passUnknownTables = 
true;
    
// pass unknown users
    filter.passUnknownUsers = 
true;
    
// pass user tables
    filter.passUserTables = 
true;
    
// don't use extended filter
    filter.rowFieldComparisonItems = 
null;
    
// pass all spids
    filter.spids = 
null;
    
// pass all tables IDs
    filter.tables = 
null;
    
// to the end of log
    filter.to = DateTime.MaxValue;
    
// pass all users
    filter.users = 
null;

    
return filter;
}

Remarks

By default maximum number of matching operation is set to 1 and all filtering is turned off except for exclusion of SQL Server internal transactions ("Allocate Root", "SplitNext" and so on)

Inheritance Hierarchy

System.Object
   ApexSql.Log.DmlFilter

See Also