Compare two tables in SQL Server I want to compare two table in SQL server and find difference.





I want Warehouse and Product combination and see the difference. I am expecting to combine and display both table together and write Null if same data is not present in other table.

For Ex:


New Jercy and IPHONE from both table and see what is difference in model and quantity.
New Jercy and IPHONE combination and comapare with San Jose and Samsung and see the difference. 
San Jose and Samsung combination and compare with TableB having San Jose and Samsung.


Can anyone help me on this.

Thank you!
Take a look at using the EXCEPT clause.

https://docs.microsoft.com/en-us/sql/t-sql/language-elements/set-operators-except-and-intersect-transact-sql?view=sql-server-ver15

SELECT WAREHOUSE, PRODUCT, MODEL, QUANTITY FROM Table1
EXCEPT
SELECT WAREHOUSE, PRODUCT, MODEL, QUANTITY FROM Table2