Domanda

I am working on a data flow task in an ssis package and I've run into this issue several times already. Here's a simple example... Suppose I have an OLE db source, a script component as a transformation, and an OLE db destination.

This is my db source query (suppose strValue is a varchar datatype in mytable)

select strValue
from mytable
where isnumeric(strValue) = 1

Then I have a script component as a transformation. strValue is an input value. When editing the script component, under "Inputs and Outputs", I expand the input variables until I can click on strValue. Under "Common Properties", it says the datatype is DT_I4 (which is an integer I believe but I never told it that).

I decide to change my db source query to remove the where clause so it is now

select strValue
from mytable

I am now going to evaluate if strValue is numeric in the script component instead. However, when I try to run this, it fails before it gets to the transformation because strValue is not always an integer anymore. The only way I've figured out to get around this is to delete the original OLE db source and the script component tranformation and then create new ones.

Is there an easy way to map the column strValue as a string, instead of an integer in the ole db source? (since I never actually set it as an integer in the first place!)

È stato utile?

Soluzione

  1. Right-click on the source object within the data flow
  2. Click "Show Advanced Editor..."
  3. Click on the last tab called "Input and Output Properties".

From there you will see the columns in the "Inputs and outputs:" box. You can then click on the individual columns and set the data types manually.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top