DataType (clsColumn)

ms133854.note(zh-cn,SQL.90).gif注意:
  下一版本的 Microsoft SQL Server 将删除该功能。请不要在新的开发工作中使用该功能,并尽快修改当前还在使用该功能的应用程序。

The DataType property identifies the data type of an object of ClassType clsColumn. This property applies only to columns of SubClassType sbclsRegular.

Data Type

ADODB.DataTypeEnum

Access

Read/write

备注

Values for the DataType property are supplied by the Microsoft® ActiveX® Data Objects (ADO) DataTypeEnum enumeration constants. For more information, see the ADO documentation.

Examples

Setting the DataType Property

The following example adds a new column to a data mining model object. It then sets various properties, including the DataType property.

'------------------------------------------------------------------------
' Add a new column to the mining model called Unit Sales and relate
' this column to the Sales cube measure of the same name. Set the
' column's data type to Integer, and identify the data content in it as
' being continuous and logarithmically normalized. Finally, identify this
' column as being predictable.
' Assume the existence of a DSO Cube object, dsoCb.
'------------------------------------------------------------------------
    'Add another column to the model.
    Set dsoColumn = dsoDmm.Columns.AddNew("Unit Sales")
    'Identify this column as being based on the Unit Sales measure.
    Set dsoColumn.SourceOlapObject = dsoCb.Measures("Unit Sales")
    'Identify the column type.
    dsoColumn.DataType = adInteger
    'Identify this column's content as being continuous.
    dsoColumn.ContentType = "CONTINUOUS"
    'Identify the statistical distribution of this data.
    dsoColumn.Distribution = "LOG_NORMAL"
    'Identify the column as being predictable.
    dsoColumn.IsPredictable = True

请参阅

参考

clsColumn

帮助和信息

获取 SQL Server 2005 帮助