Condividi tramite


clsColumn

[!NOTA]

  Questa caratteristica verrà rimossa a partire dalla prossima versione di Microsoft SQL Server. Non utilizzare questa caratteristica in un nuovo progetto di sviluppo e modificare non appena possibile le applicazioni in cui è attualmente implementata.

Data mining column objects (that is, objects of ClassType clsColumn), along with data mining model objects, provide a programmatic interface to data mining capabilities. Data mining automates data analysis by applying algorithms to reveal historical and predictive patterns within large databases. The class type clsMiningModel is provided by Decision Support Objects (DSO) to represent data mining models. Data mining models are the primary objects for predictive analysis, just as a cube is the primary object for OLAP analysis. Objects of ClassType clsColumn are used to define the structure of mining model objects through the Columns collection of the model. Columns are provided with collections and properties through their default interface, the Column interface, for interacting with them. There are no methods associated with clsColumn objects.

Osservazioni

An object of ClassType clsColumn can have a SubClassType of sbclsRegular or sbclsNested. A column of SubClassType sbclsRegular is an individual data column, whereas a column of SubClassType sbclsNested represents a nested table composed of multiple individual data columns.

You create column objects by declaring a variable as a clsColumn data type and then creating an instance of the object and adding it to the Columns collection of either a mining model object or another column object. The AddNew method of the Columns collection creates the instance, sets the name of the object to the name you provide, adds the object to the collection, establishes the SubClassType of the column, and sets its Parent property to reference the owner of the collection.

Examples

Adding a New Column to a Data Mining Model

The following example demonstrates how to add a new column to a data mining model:

'------------------------------------------------------------------------
' Add a new column to the mining model called Gender and relate this
' column to the Gender member property of the Name level of the
' Customers dimension. Declare that the data in this column is 
' statistically discrete.
' Assume the existence of a DSO Level object, dsoLvl.
'------------------------------------------------------------------------
    'Add another column to the model.
    Set dsoColumn = dsoDmm.Columns.AddNew("Gender")
    'Identify the member property of the Customers dimension
    'that this column is based on.
    Set dsoColumn.SourceOlapObject = dsoLvl.MemberProperties("Gender")
    'Identify its type.
    dsoColumn.DataType = adWChar
    'Make this column related to the Customer Id column.
    dsoColumn.RelatedColumn = "Customer Id"
    'Identify this column as one containing discrete data.
    dsoColumn.ContentType = "DISCRETE"