Dynamic SP to delete duplicate Rows across all tables in Azure Synapse

Lawrence Nkwana 21 Reputation points
2021-09-16T18:18:26.073+00:00

Hi There

I am battling to write Stored procedure that can delete all duplicate rows across all tables in Azure Synapse. Anyone who can help?Thanks in advance.

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,422 questions
{count} votes

Accepted answer
  1. ShaikMaheer-MSFT 37,971 Reputation points Microsoft Employee
    2021-09-20T06:58:47.06+00:00

    Hi @Lawrence Nkwana ,

    Thank you for posting query in Microsoft Q&A Platform.

    You can have delete duplicate rows from table logic inside an stored procedure by parameterizing table name. Call that stored procedure from Synapse Pipeline using Stored procedure activity inside ForEach activity loop. Pass your all tables in array to ForEach activity.

    So, technically ForEach activity will take all table names as array and iterate over them and pass each table name to stored procedure for each execution. Your stored procedure will delete duplicate rows for that specific table on each iteration.

    Below are few reference links where different ways explained to delete duplicate rows from table.

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators
    0 comments No comments

0 additional answers

Sort by: Most helpful