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.
- https://www.sqlshack.com/different-ways-to-sql-delete-duplicate-rows-from-a-sql-table/
- https://www.mssqltips.com/sqlservertip/4486/find-and-remove-duplicate-rows-from-a-sql-server-table/
- https://www.codeproject.com/Questions/546093/howplustoplusdeleteplusduplicateplusrecordsplusbyp
- https://codingsight.com/how-to-delete-duplicate-records-in-a-table/
- https://codingsight.com/multiple-ways-to-remove-duplicates-from-sql-tables/
Hope this will help. Please let us know if any further queries.
------------------------------
- Please don't forget to click on or upvote 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