Partager via


FromClause (clsColumn)

[!REMARQUE]

  Cette fonctionnalité sera supprimée dans la prochaine version de Microsoft SQL Server. Évitez d'utiliser cette fonctionnalité dans de nouveaux travaux de développement, et modifiez dès que possible les applications qui utilisent actuellement cette fonctionnalité.

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

[!REMARQUE]

  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.

Notes

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"

Voir aussi

Référence