question

LawrenceNkwana-9127 avatar image
0 Votes"
LawrenceNkwana-9127 asked ShaikMaheer-MSFT edited

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

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
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @LawrenceNkwana-9127 ,

Following up to see if the above answer helped. If this answers your query, do click 130616-image.png and 130671-image.png for the same. And, if you have any further query do let us know.



1 Vote 1 ·

Hi @LawrenceNkwana-9127 ,

Just checking in to see if the above answer helped. If this answers your query, do click 130616-image.png and upvote 130671-image.png for the same. And, if you have any further query do let us know.

0 Votes 0 ·

1 Answer

ShaikMaheer-MSFT avatar image
0 Votes"
ShaikMaheer-MSFT answered

Hi @LawrenceNkwana-9127 ,

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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.