Question : Insert new records only

I'm trying to insert only new records into a table and wanted to know if this was the best solution.  I know if I was only comparing one field in the different tables I could do a not in (select distinct etc...) but the new value is based on two fields creating the unique value.  This is the query I'm considering using.  Any better ways of doing this?


INSERT INTO SGroups(DepartmentID, SGroupName)
SELECT DISTINCT A.Department, A.SGroup
FROM EmpData_Dump A LEFT JOIN SGroups B ON A.Department = B.DepartmentID and A.SGroup = B.SGroupName
WHERE B.DepartmentID IS NULL AND B.SGroupName is null

Answer : Insert new records only

What I really meant to put was:
1:
2:
3:
4:
5:
6:
INSERT INTO SGroups(DepartmentID, SGroupName)
SELECT DISTINCT A.Department, A.SGroup
FROM EmpData_Dump A 
EXCEPT 
SELECT DISTINCT B.DepartmentID, B.SGroupName
FROM SGroups B
Random Solutions  
 
programming4us programming4us