# Data Comparison using Powershell

**URL:** <https://forums.powershell.org/t/data-comparison-using-powershell/16066>\
**Category:** PowerShell Help\
**Created:** [March 24, 2021, 3:12pm UTC](https://forums.powershell.org/t/data-comparison-using-powershell/16066 "2021-03-24T15:12:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sp\_analytics](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sp\_analytics](https://forums.powershell.org/u/sp_analytics)\
**Post date:** [March 24, 2021, 3:12pm UTC](https://forums.powershell.org/t/data-comparison-using-powershell/16066/1 "2021-03-24T15:12:04Z")

</div>

Can some one please point me to the PS script which compares the data between Table(A) from Server#1(Azure synapse) and Table(B) from Server#2(Azure Managed SQL Server Instance). Regardless of the outcome(Match/No-Match) I would like to setup a email notification with output and a outcome message.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/2X/4/44980f17cf97039d0dcd7bdc950999609c93833a.png)

Please let me know. TIA.

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [March 24, 2021, 3:24pm UTC](https://forums.powershell.org/t/data-comparison-using-powershell/16066/2 "2021-03-24T15:24:17Z")

</div>

There is a cmdlet available to compare object :

> **[Compare-Object (Microsoft.PowerShell.Utility) - PowerShell](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/compare-object?view=powershell-7.2&viewFallbackFrom=powershell-7.1)**
>
> The Compare-Object cmdlet compares two sets of objects. One set of objects is the reference, and the other set of objects is the difference. Compare-Object checks for available methods of comparing a whole object. If it can't find a suitable method,...

How do you actually get this tables? There might be a better way for collecting the data. The format you show is not the best for comparison. 😉

---

<div class="post-metadata">

**Author:** ![sp\_analytics](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sp\_analytics](https://forums.powershell.org/u/sp_analytics)\
**Post date:** [March 24, 2021, 5:15pm UTC](https://forums.powershell.org/t/data-comparison-using-powershell/16066/3 "2021-03-24T17:15:58Z")

</div>

Thank you, Olaf. sorry, I didn’t quite get ur message but, I am open for any kind of suggestions that you have.

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [March 24, 2021, 6:57pm UTC](https://forums.powershell.org/t/data-comparison-using-powershell/16066/4 "2021-03-24T18:57:31Z")

</div>

> [@sp\_analytics](#):
>
> sorry, I didn’t quite get ur message but, I am open for any kind of suggestions that you have.

No problem. You may start with answering the question I asked and continue with reading the help I linked for you. Rread it completely including the examples please.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:26pm UTC](https://forums.powershell.org/t/data-comparison-using-powershell/16066/5 "2024-05-16T20:26:59Z")

</div>

Closed on May 16, 2024, 8:26pm UTC


