Compare two tables in same Database
This is an example:
If I have table `dbo.PortsBaselineTable` and `dbo.PortsTable`
Each have the exact same column names:
I want to be able to query the resulting differences. The dbo.PortsBaselineTable will have about 6000 rows and the Baseline Column will have the number '1', the dbo.PortsTable will continually add data and the Baseline Column will have '0' for all rows. I want to pick two dates one from each table and compare all the rows that are different based on the two particular dates and then grouped by computer name.
Is this even feasible? I would mind having the data in the same table with just the baseline flag changing as I add more data.
Here is a snapshot of the result set:
Date Plant ComputerName Protocol LocalAddress LocalPort RemoteAddress RemotePort State ProcessName Baseline
2014-01-30 07:52:58 plantname COMPUTERNAME TCP 10.10.40.100 49157 192.168.0.2 64807 ESTABLISHED lsass 1