Hi,
There is a small correction of bracket. That will get rid of the error and show you the correct result.
select * from [TflStars].[dbo].[Contact]
where [ContactID] NOT IN ( select [ContactID] from [TflStars].[dbo].[UserDetail]) AND [ContactID] NOT IN (select [ContactID] from [TflStars].[dbo].[SchoolContact])
But inner query may slow down the execution of query. So you have another option of combination of "except" and "union". Please try below query.
select ContactID from [TflStars]
EXCEPT
(SELECT ContactID FROM UserDetail
UNION
SELECT ContactID FROM SchoolContact
)
Please let me know if you have any concern or query or if you are still facing issue.
Thanks
Advay Pandya