Freigeben über


FromClause (clsColumn)

HinweisHinweis

  Diese Funktion wird in der nächsten Version von Microsoft SQL Server entfernt. Verwenden Sie diese Funktion beim Entwickeln neuer Anwendungen nicht, und planen Sie so bald wie möglich das Ändern von Anwendungen, in denen es zurzeit verwendet wird.

The FromClause property of an object of ClassType clsColumn specifies the FROM clause of the SQL query that returns a nested table.

HinweisHinweis

  This property applies only to columns that belong to mining model objects of SubClassType sbclsRegular.

Data Type

String

Access

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

Hinweise

For columns with a SubClassType of sbclsRegular, this property returns the Filter property of the parent object. Columns can be nested, so the parent object can be either a clsMiningModel object or a clsColumn object.

Examples

Creating a New Nested Column

The following code creates a new nested column called Products. It uses the FromClause and JoinClause properties to establish the SQL joins to the parent table. It then creates a new column called CustomerID and establishes that this column contains key values from the parent table by setting the IsParentKey property to TRUE. The clsColumn object that contains the keys in the parent table is referred to by the value of the RelatedColumn property: KeyColumn.

' Create a new nested column.
Set dsoNestedCol = dsoDmm.Columns.AddNew("Products", sbclsNested)
dsoNestedCol.FromClause = """Sales"", ""SalesReps"", ""Products"""
dsoNestedCol.JoinClause = """Sales"".""SalesRep"" = ""SalesReps"".""Name""" & _
    " AND ""Sales"".""Product"" = ""Products"".""Product"""
dsoNestedCol.Filter = ""

' Create a new column that contains key values from the parent table.
Set dsoColumn = dsoNestedCol.Columns.AddNew("CustomerID")
dsoColumn.SourceColumn = """Products"".""CustId"""
dsoColumn.DataType = adInteger
dsoColumn.IsParentKey = True
' The RelatedColumn property is set to the clsColumn object used
' as the key column for the data mining model.
dsoColumn.RelatedColumn = "KeyColumn"

Siehe auch

Verweis