Somthing like this Declare @Childtable TAble (fk_fld1 int,fk_fld2 int)Declare @ParentTable Table (pk int)Insert @ParentTable Select 1 union all select 2 union all select 3 union all select 4 Insert @childTable Select 1,null union all Select null,2 union all Select null,3union all Select 4,nullSelect * From @ParentTable,@ChildTable Where (fk_fld1 is null or fk_fld1 = pk) And (fk_fld2 is null or fk_fld2 = pk)
If Debugging is the process of removing Bugs then i Guess programming should be process of Adding them.