none
Copy activity csv -> stored procedure

    Question

  • Hi, 

    We a doing a copy activity with csv file -> stored procedure.

    Can't get it to work or it might not be possible to do it this way.

    Csv sample: 

    2533274***84324,4c123e07-ed78-49a6-**b2-6eca3754c9d8,2016-03-09,IntroPack,1,true,false,false,false,false,false,,,2016-03-09T15:29:21.3720559

    253327***384324,4c123e07-ed78-49a6-**b2-6eca3754c9d8,2016-03-09,IntroPack,1,true,false,false,false,false,false,,,2016-03-09T17:16:44.4288425

    2533274***582312,712cdc45-159f-4435-**7c-d5d96ce3453a,2016-03-09,IntroPack,1,true,false,false,false,false,false,,,2016-03-09T21:30:07.1650047

    2533274825711606,17bd99d4-390a-45f8-***9-00dd4b791f8c,2016-03-09,IntroPack,1,true,false,false,false,false,false,,,2016-03-09T19:36:52.8325031

    There can be rows multiple rows with the same key pair. 

    2533274821384324,4c123e07-ed78-49a6-93b2-6eca3754c9d8 are primary key pair in table.

    The stored procedure uses merge to update some fields if they have changed otherwise if  the 'on' condition using the key pair is not matched row is inserted.

    The problem is it fails on duplicate key contraint error because the on condition is never triggered is there is no row. Even tried selecting only on row pr. key pair but that also fails sometimes.

    My guess is that it might be a transactional constrain?
    • Moved by Mike Laughlin Friday, October 14, 2016 12:10 PM From 'Forums Issues' - not reporting an issue with the forums.
    Friday, October 14, 2016 11:58 AM

Answers