The PreValidateSchema method validates the schema of the source and destination columns to be transformed. It is called from Data Transformation Services (DTS) Designer at the time the transformation is being configured.
HRESULT PreValidateSchema (
LPCDTSTransformColumnMetadata pSrcMetadata,
LPCDTSTransformColumnMetadata pDestMetaData,
DTSTransformFlags eTransformFlags,
DTSTransformPhaseEnum ePhases );
Argument | Description |
---|---|
pSrcMetadata [in] | Source column meta data |
pDestMetaData [in] | Destination column meta data |
eTransformFlags [in] | Input flags for transformation validation and execution |
ePhases [in] | Phases this transformation is expected to support |
PreValidateSchema provides validation at the time the package is built, rather than when it is executed. It is called from DTS Designer when the user selects the Only Show Valid Transformations check box in the Create New Transformation dialog box and when the Transformation Options dialog box is closed. It is passed the meta data for the source and destination columns, the transformation flags and a bitmask defining the phases the transformation is expected (by the caller) to support.
Any level of validation can be provided, up to and including that done by IDTSDataPumpTransform::ValidateSchema. However, Only Show Valid Transformations simply removes the transformation name from the Create New Transformation dialog box, so complex validations may leave the user wondering why the transformation is not valid.
The transformation flags, which use values from DTSTransformFlags, define the data type promotion, demotion and conversions that are allowed. However, PreValidateSchema is not called when they are changed from the Transformation Flags dialog box, so you may want to defer validation involving the flags to ValidateSchema.
The source and destination column meta data structure DTSTransformColumnMetadata has these fields.
Field | Description |
---|---|
cColumns | Count of source or destination columns. |
rgDBColumnInfo | Pointer to an array of OLE DB DBCOLUMNINFO structures. There is one array element for each column. |
For more information about the DBCOLUMNINFO structure, see Column Information Structures in DTS Transformations.