Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Azure icon
Labs

Upserting Data in Azure Synapse Analytics

Upsert allows you to insert and update data in the target table as a single transaction. Here, we’ll upsert the data using a Synapse pipeline in a dedicated SQL pool table. In the first run, we'll load all the records in the table. And in the second run, we'll insert and update records as a single transaction.

Azure icon
Lab platform
Lab Info
Level
Intermediate
Last updated
Sep 24, 2025
Duration
45m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Set Up the Environment
    1. Create an Azure Synapse Analytics instance by defining a new Azure Data Lake Gen2 account.
    2. Create a container named taxidata in the Data Lake account.
    3. Upload the TaxiRides.csv file in the container. The file link is available in the Additional Information and Resources section.
  2. Challenge

    Set Up Dedicated SQL Pool Instance

    Within Synapse workspace, create a dedicated SQL pool instance named TaxiRidesWarehouse, with the performance level of DW100c.

  3. Challenge

    Create a Pipeline to Copy Data from Data Lake File to Dedicated SQL Table
    1. Create a linked service for the data lake.
    2. Create a TaxiRides table in the dedicated SQL pool. The script to create it is available in the Additional Information and Resources section.
    3. Create a pipeline with a Copy activity.
    4. From the source of the Copy activity, create an integration dataset for the data lake file. Use the format as Delimited Text.
    5. From the sink of the Copy activity, create an integration dataset for the dedicated SQL pool table, TaxiRides. Use Azure Synapse dedicated SQL pool as the data store.
    6. In the sink of the Copy activity, set Copy method as Upsert. Add RideId as the key column.
  4. Challenge

    Complete Initial File Load
    1. Run the pipeline.
    2. Use an SQL query to verify that 100 records have been successfully added to the table.
    3. Verify that the PassengerCount column value for RideId = 1 is 1.
  5. Challenge

    Upsert Data from File to Dedicated SQL Table
    1. In the data lake account, open and edit the file TaxiRides.csv.
    2. In the file, only keep the record for RideId = 1 and set PassengerCount = 2. Remove all other records.
    3. In the file, add a new record for RideId = 10000. Add any data for the record but make sure to add the right number of columns.
    4. Save the file changes and run the pipeline.
    5. Verify that the table now has 101 records, with an additional record for RideId = 10000.
    6. Verify that the PassengerCount column value for RideId = 1 is now updated to 2.
About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight