Compare difference in columns between two tables

Kirthiga
Posted by Kirthiga under Sql Server category on | Points: 40 | Views : 993
select A.Table_Name,A.column_Name,B.Table_Name,B.column_Name
from
(select * from INFORMATION_SCHEMA.COLUMNS where Table_Name= 'Table1') A
full outer Join
(select * from INFORMATION_SCHEMA.COLUMNS where Table_Name= 'Table2') B
on A.Column_Name = B.Column_Name
where A.COLUMN_NAME is null or B.COLUMN_NAME is null

Comments or Responses

Login to post response