David try this
HTH Mike
IF Object_ID('TempDB..#Parent')>0
DROP TABLE #Parent
IF Object_ID('TempDB..#Child') > 0
DROP TABLE #Child
CREATE TABLE #Parent
(
Pk int,
OtherStuff VarChar(20)
)
CREATE TABLE #Child
(
FKParent int
)
DECLARE @Count int
Set @Count = 0
While @Count <10
Begin
Set @Count = @Count + 1
INSERT INTO #Parent(PK)
VALUES(@Count)
IF @Count < 5
INSERT INTO #Child(FKParent) VALUES(@Count)
End
GO
SELECT P1.pK
FROM #Parent p1
WHERE NOT EXISTS
(
SELECT p.pk
FROM
#Child c
JOIN
#Parent p
ON c.FKParent = P1.pk
 
--
/*
Results 5,6,7,8,9,10
Records 1-4 have parents
Edited to change Mark to David. Addressed the wrong person sorry
*/