I have two tables with 70 columns each and they have same columns names in each table. I want to compare the data of every column and the output is number of rows which are different of every column. So far I am successful in comparing the data but I have to manually replace the column names in query instead I would like the query to pick all the columns data from both the tables and compare them and give output. Below is the query and sample output.
select NEEF_Entry.dbo.tbl_TOF.StudentsClass4_15,NEEF_Entry.dbo.tbl_TOF_old.StudentsClass4_15 from NEEF_Entry.dbo.tbl_TOF join NEEF_Entry.dbo.tbl_TOF_old ON NEEF_Entry.dbo.tbl_TOF.FormID=NEEF_Entry.dbo.tbl_TOF_old.FormID where NEEF_Entry.dbo.tbl_TOF.StudentsClass4_15<>NEEF_Entry.dbo.tbl_TOF_old.StudentsClass4_15