Showing posts with label referencing. Show all posts
Showing posts with label referencing. Show all posts

Friday, March 30, 2012

Losing decimal places on Sql Svr to Sql Svr data flow

Hi,

I have a staging table that has a float [DT_R8] column that shows 4 decimal places. When I use an OLE DB Source referencing that table to go to an OLE DB Destination referencing a table with an identical column the data gets rounded to a single decimal place. Needless to say this is really messing with the values.

I can see the Scale property in the Advanced Editor for OLE DB Destination but I cannot change it. Same for the OLE DB Source.

Oh, and if I do an insert using SQL in Management Studio I have no problem getting the 4 decimal places in. For example:

Insert into table2
(Col1, Col2)
select Col1, Col2 from table1

Moves all the data and keeps the 4 decimal places.

How do I do this without losing those decimals?

Thanks
John
Do you have the SSIS datatypes set to DT_R8? Double click on the green line coming out of the OLE DB source and in the metadata tab, what's the data type set to?

(Just asking the perhaps obvious question for completeness.)|||The datatype for that column is DT_R8 in the OLE DB Source (both External and Output columns), OLE DB Destination (both External and Input columns) and in the green line metadata.

John
|||Works fine for me. Maybe you've got some old metadata stuck somewhere. Try putting a Data Viewer on the pipeline at various points (if there are various points) to see what it looks like in flight. Maybe you need to delete and recreate some components or the whole data flow to get it straightened out. What method/query are you using to pull the data from the source? What type of connections are you using?
|||While recreating the data flow, I checked the view and it appears that the problem is happening just before the package executes.

Thanks for all the help.

Monday, March 19, 2012

Lookup Task Datatype issue

Hello:

I'm attempting to use the lookup task and i'm running into an issue about incompatible datatypes.

The table that i'm referencing in the lookup has a field named DateCreated, and it's DataType is DateTime.

But when I hook it up to the Lookup Task, the lookup task thinks it's a DB_Timestamp, so i get an incompatible data type error.

What can i do?

i'm not sure if this would resolve your issue, but have you tried using the data conversion component?|||

Duane:

Thanks for your reply.

My problem is not with the dataflow, but with the Lookup Task misinterpreting the Data Type of one of the columns in my lookup table.

Instead of being DateTime as the column is set to, the the Lookup task thinks the column is a DB_Timestamp.

|||

SamuelEe,

maybe i misunderstood you. however, the lookup transformation is a data flow component.

|||

SamuelEe wrote:

Duane:

Thanks for your reply.

My problem is not with the dataflow, but with the Lookup Task misinterpreting the Data Type of one of the columns in my lookup table.

Instead of being DateTime as the column is set to, the the Lookup task thinks the column is a DB_Timestamp.

Duane's suggestion is still valid. Try changing the type of the column in the pipeline to DT_DBTIMESTAMP as well so that it can match with what the LOOKUP component has got.

The LOOKUP component is not misinterpreting anything. Datetime fields from database tables get interpreted as DT_DBTIMESTAMP in a SSIS data flow.

-Jamie