I'm working on some performance tests for my ORM.
I just noticed this with the 2010; these two queries return results.
SELECT distinct UserId FROM Comments WHERE not UserId in (Select ID From Users) order by UserId
SELECT distinct OwnerUserId FROM Posts WHERE not OwnerUserId in (Select ID From Users) order by OwnerUserId
Meaning I have child records pointing to non-existent users. I know Stack Overflow allows users to be deleted but shouldn't child data also have been removed. Or better, just clear the user fields and set the name to "deleted".
Now I have to make additional tests for integrity for my performance tests.