I have this query that returns 27074 rows from the source table:
SELECT
[DOC NO]
,[LineNumber]
,[SHEET]
,[TestPkgNo]
,[ITEM CODE]
FROM
[excel].[dbo].[MTO2]
And this one (second table )
SELECT
DocumentNumber, LineNumber, SheetNumber, PackageNumber, ItemCode
FROM
[SPMS2].[dbo].[Materials]
JOIN
Lines ON materials.LineId = Lines.Id
JOIN
MaterialDescriptions ON MaterialDescriptions.Id = Materials.MaterialDescriptionId
JOIN
TestPackages ON TestPackages.Id = Materials.TestPackageId
This returns 27032 rows.
I want to find the difference between two tables, I mean the result should be like this :
doc line sheet testpack sourcetable secondtable
** * * * ok not ok