Forum Discussion

michaelgambling's avatar
michaelgambling
Advocate I
1 year ago
Solved

Data Ingestion Troubles

Hi All,   Pulling my teath out a bit trying to get my head around data ingestion.    I am new to Fabric and data engineering in general. I am trying to set up a metadata driven pipeline that impl...
  • smeetsh's avatar
    1 year ago

    Is it an option for you to use SQL and the gateway connector to get your data from the on-prem SQL server and load that in , what i would call, a raw table (for instance tablename:  mydata_raw) and next  use a merge in a notebook to merge your raw data with your existing data? Since you only ingest specific data from your sql server, the overwrite of your "mydata_raw" table, should not impact CU's to much.

    The notebook code would look something like below ("name" is just an example column)

    %%sql
    MERGE INTO mydata AS target
    USING mydata_raw AS source
    ON target.id = source.id
    WHEN MATCHED THEN
    UPDATE SET target.name = source.name 
    WHEN NOT MATCHED THEN
    INSERT (id, name) VALUES (source.id, source.name);

     

    Cheers

    Hans