Wednesday, March 7, 2012

DTSX package data transfer error

I will try to explain things the best I can.

When the data is transferred from source to destination (replace not append), the data in one field in one table is incorrect. Both source and destination tables have the same number of rows (8493). The ProductID field data range at the source is from 58958 to 73008. When the table is copied the ProductID field data runs from 1 to 8493.

What would cause this skewing of data?

This happens on brand new dtsx packages and this only happens in one field out of 5 different tables.

I am baffled. Any help is appreciated.

Thanks.

Andrew

Sounds like ProductID is an identity field.

In the OLE DB destination, ensure that you are using a data access mode of "Table or view - fast load" and then make sure the check box is selected for "Keep identity."

See if that helps.|||

Thanks for the quick response Phil.

Where exactly do I look for this setting in Visual Studio?

I must be overlooking it.

Thanks.

Andrew

|||It's in the OLE DB Destination component. Double click on it.|||Did you develop the package, or use the Import/Export wizard?|||I devolped it.|||

FordyH500HP wrote:

I devolped it.

Then what destination are you using? Use the OLE DB Destination if you're not using it already.|||

I'm using the Transfer SQL Server Objects Task from the toolbox.

Will that work for what you are talking about?

|||

FordyH500HP wrote:

I'm using the Transfer SQL Server Objects Task from the toolbar.

Will that work for what you are talking about?

Ahh... What values for the options under "Table Options" do you have?|||

Sorry if I should have stated that sooner.

I'm just above Newbie status in Visual Studio.

CopyIndexes - True

CopyTriggers - False

CopyFullTextIndexes - False

CopyPrimaryKeys - False

CopyForeignKeys - False

GenerateScriptsInUnicode - False

|||What happens if you set CopyPrimaryKeys and CopyForeignKeys to True?|||Same result. It renumbers the ProductID field starting with 1.|||

FordyH500HP wrote:

Same result. It renumbers the ProductID field starting with 1.

Yep, doing a quick search shows that the Transfer SQL Server Objects task does not support identity columns. Will future versions?

Let's find out:
[Microsoft follow-up]

You can do this on your own though, by using an execute sql task in the control flow to truncate the destination tables and then as many data flows as you have tables. Inside the data flows, you can use an OLE DB source and hook it up to an OLE DB destination, and use the options I suggested above.|||

Ok. I think I understand.

So I want to check Keep Identity then in the data flow destination?

Also, can I put multiple Source/Destinations in one data flow?

|||Yep

No comments:

Post a Comment