logic to do nothing if all columns of an existing record are same
<p>I have a sql table with some records and everyday I am importing records into the table but I dont want to import records where 5 out of 10 fields havent changed. For example:</p>

<pre><code>Table_A
A(PK) B C D E
1     2 2 3 4
</code></pre>

<p>Now, if I am importing a record and values in column A,B,C and D havent changed then I dont want to import that record into column A.</p>

<p>Below is the query I am trying to run</p>

<pre><code>insert into STG_EmployeeMaster
(Name,PrefName,GPN,BU,BUName,SMU,SMUName,OU,Sector,Rank,MU,MUName,EmpStatus,Grade,StartDate,StdHrs,SSL1,SSL2,City,StateProv,Country,CounselorName,CFL,FTE,LastPromoDate,CurEmpDate,BULevel2,ExpReturnDate,GUI,Ac_Flg,Exist_Flg,Ac_Flg_StartDate,EmpSubCompetency,SectorTagClassification)

select 
t1.Name,
t1.PrefName,
t1.GPN,
t1.BU,
t1.BUName,
t1.SMU,
t1.SMUName,
t1.OU,
t1.Sector,
t1.Rank,
t1.MU,
t1.MUName, 
t1.EmpStatus,
t1.Grade,
t1.StartDate,
t1.StdHrs,
t1.SSL1,
t1.SSL2,
t1.City,
t1.StateProv,
t1.Country,
t1.CounselorName,
t1.CFL,
t1.FTE,
t1.LastPromoDate,
t1.CurEmpDate,
t1.BULevel2,
t1.ExpReturnDate, 
t1.GUI,
'Y',
case when t1.GPN in (select distinct GPN from STG_EmployeeMaster)
then 'N' else 'Y' end,
getdate(),
t3.EmpSubCompetency,
t3.SectorTagClassification

from Temp_EmployeeMaster t1

left join SRC_EMS t3
on t1.GPN=t3.resourceGPN
left join STG_EmployeeMaster t2 
on t1.GPN=t3.ResourceGPN

where not exists( select 1
from dbo.stg_employeemaster t2
where t2.GPN = t1.GPN
and t2. BU = t1.BU
and t2.SMU = t1.SMU
and t2.OU = t1.OU
and t2.Sector =  t1.Sector
and t2.Rank = t1.Rank
and t2.MU = t1.MU
and t2.Grade =  t1.Grade
and t2.EmpSubCompetency = t1.EmpSubCompetency
and t2.SectorTagClassification = t1.SectorTagClassification
and t2.City = t1.City
);
</code></pre>