Sunday, March 25, 2012

Derived Column Calculation

Example: (47 / 204709) * 12000 = 2.754

Both values (47 & 204709) are of data type Int.

SQL Sever - Derived Column Calculation returns 2.74

The destination data type is Float

I have converted the data types to Float, Decimal & Numeric and still got the same answer.

Any suggestions

Have you casted the result of the calculation to a float?

-Jamie

|||

Yes, I have what I have noticed with the Data Convertion component is that the input and output data types stay the same. Should it not change to the new data type.

|||

Can you post your expression up here?

-Jamie

|||

Michael Exall wrote:

Yes, I have what I have noticed with the Data Convertion component is that the input and output data types stay the same. Should it not change to the new data type.

No. If you were changing the data-type of a column then inherently you are changing the "shape" of the memory buffer and therefore this would need to be an asynchronous component.

A design choice was obviously made to keep data conversion component synchronous for perf reasons.

If you're puzzled as to the difference between synch and asynch...google it http://www.google.co.uk/search?hl=en&q=ssis+synchronous+asynchronous&meta=

-Jamie

No comments:

Post a Comment