Showing posts with label flow. Show all posts
Showing posts with label flow. Show all posts

Tuesday, March 20, 2012

Convert varchar(12) to binary(12)

I need help converting a varchar field to binary.

I have a Data Control Task that has a OLE DB Source and corresponding OLE DB Destination Data Flow Task. In the referenced source table there exists a field defined as a varchar(12), in the corresponding destination table it is defined as a binary(12). How do I perform this conversion?

I tried inserting a Data Conversion Task and assigning the new data type as byte stream[DT_BYTES] and a Length = 12, but this was a bust. Output test is as follows:

Error: 0xC020901C at DFT - Windows, OLE_SRC - Windows [1]: There was an error with output column "Payload" (40) on output "OLE DB Source Output" (12). The column status returned was: "The value could not be converted because of a potential loss of data.".

Can anyone help me out here?

Regards,

What is the SSIS data type assigned to the source column? Right-click on the data flow error and slect Edit and then go to the Metadata tab of the Data Flow Path Editor dialog.

Is it DT_WSTR or DT_STR?

My guess is that SSIS is treating your input field as a Unicode string (DT_WSTR) so each of the 12 characters is taking up 2 bytes.

Sunday, February 12, 2012

Convert DT_14 to DT_18


Hi!
I have a Fact_data flow with several Lookups.
In one there's OLE Db source DT_14 (persons id's) which need to be compared to a column DT_18 from Dim_salesperson. Thats how I could collect the ID's from Dim_salesperson into OLE DB Destination. How could I compare, DT_14 data with DT_18?
First converting DT_14 to character. Secondly char to DT_18?
I would be so grateful if someone could give an idea...

curiousss wrote:



First converting DT_14 to character. Secondly char to DT_18?

Assuming you are talking about DT_I4 and DT_I8; that approach sounds reasonable. Have you try it?

|||Thanks, problem solved!