Export (0) Print
Expand All

SourceColumn (clsColumn)

SQL Server 2000

SourceColumn (clsColumn)

The SourceColumn property of an object of ClassType clsColumn identifies the name of its source column in a relational table. This property applies only to columns belonging to mining model objects of SubClassType sbclsRegular.

Data Type

String

Access

Read/write for columns with a SubClassType of sbclsRegular, read-only for all others.

Remarks

For columns with a SubClassType of sbclsNested that belong to a mining model object of SubClassType of sbclsRegular, this property returns an empty string.

To understand the function of this property, consider the relationships of columns in a model to an SQL query. If you use a SELECT query to define the structure of a table when you create a mining model, the contents of this property for each column in the model correspond to a column designation within the SELECT query. For example, consider the following query:

SELECT "Key" AS "CustId", "Age" AS "Age" FROM "People"

If a mining model were to be created using this SELECT statement, the SourceColumn properties for each column would be "Key" and "Age" respectively.

Examples
Creating a Data Mining Model

The following example creates a data mining model based upon the People table of a relational database. This table is specified by the FromClause property. Because the model is based upon a single table, no joins are needed. It then creates and adds two columns to the model's Columns collection. Each column is related to a field in the original relational table (that is to say, the People table) by setting the SourceColumn property of each column to the appropriate value.

dsoDmm.Description = "Analyzes the purchasing behavior of customers"
dsoDmm.MiningAlgorithm = "Microsoft_Decision_Trees"
dsoDmm.FromClause = "People"
dsoDmm.JoinClause = "" ' None is needed because there is only a single table.
dsoDmm.Filter = ""
dsoDmm.TrainingQuery = "" 'Let DSO figure out the training query.

Set dsoColumn = dsoDmm.Columns.AddNew("CustId")
dsoColumn.SourceColumn = "People.Key"
dsoColumn.DataType = adInteger
dsoColumn.IsKey = True

Set dsoColumn = dsoDmm.Columns.AddNew("Age")
dsoColumn.SourceColumn = "People.Age"
dsoColumn.DataType = adDouble
dsoColumn.ContentType = "CONTINUOUS"
Show:
© 2014 Microsoft