SmoCollectionBase.ClearAndInitialize Method

Definition

Clears old objects and initializes the collection

C#
public void ClearAndInitialize(string filterQuery, System.Collections.Generic.IEnumerable<string> extraFields);

Parameters

filterQuery
String

the xpath to filter the objects by properties (e.g. setting the filter to [(@IsSystemObject = 0)] will exclude the system objects from the result. By setting the parameter to null or empty string, no filter will be applied to the result

extraFields
IEnumerable<String>

the list of fields to be loaded in each object. (e.g. setting the extraFields to "new string[] { "IsSystemVersioned" })" when calling this method for TableCollection will include "IsSystemVersioned" property for each table object. By setting the parameter to null or empty array, only the default fields will be included in the result

Applies to

Producto Versiones
Microsoft.SqlServer.SqlManagementObjects 150.18208.0, 160.2004021.0