Glenn94
Glenn94

Reputation: 189

SSIS Package to copy data from one to another error

I have setup a SSIS package to copy over some data from one table to another. At first I tried doing from one server to another server, did not succeed. Then I tried it doing within the same server, no luck again. I followed couple tutorials/videos how to do it and followed the exact pattern.

enter image description here

However here's what I tried to do:

When I run the package I get following errors

errors

Here are the 5 errors that are in the above figure,

Now I have tried applying couple of solution that I found in stackoverflow and out in the internet, such as following but nothing helped me so far.

Any help is greatly appreciated!

Upvotes: 0

Views: 1261

Answers (2)

Glenn94
Glenn94

Reputation: 189

For anyone who's interested or had the same issue as mine, I just found the answer. I was using the wrong TargetServerVersion in project properties. My SQL server is 2016 and it was defaulted to 2019 automatically in this property page. I did change it back to 2016 and yes it all starts working. success

Upvotes: 2

Nick.Mc
Nick.Mc

Reputation: 19184

I suggest that you do not use SSIS to move data around inside a database. Just use a stored prcedure or script. Here is a sample script that will copy data from one table to another, but only for data that doesn't exist in the target.

insert into targettable (PrimaryKeyColumn,Column1,Column2,Column3)
select PrimaryKeyColumn,Column1,Column2,Column3
from sourcetable SRC
where not exists (
    select * 
    from targettable TGT 
    where TGT.PrimaryKeyColumn = SRC.PrimaryKeyColumn
)

Upvotes: 1

Related Questions