• Try simplifying the query for testing just to see what you have in the Projects table without all of the other INNER JOINS. (I agree with Sean that the other tables look like a dreaded EAV schema which is a PITA and a real performance killer. But that's a different topic.)

    Run these two queries and it should show you the results for each state of 'Deleted' so you will have a better idea of what you are dealing with.

    SELECT

    P.*

    FROM

    Projects AS P

    WHERE

    P.Deleted = 0

    SELECT

    P.*

    FROM

    Projects AS P

    WHERE

    P.Deleted = 1

    If you do in fact have rows returned with Deleted = 0 (assuming here this is a BIT datatype or at least INT) then you can run a delete command (always make a backup first!!):

    DELETE FROM Projects

    WHERE Deleted = 0

    It's also possible that the Deleted column is a different datatype such as CHAR(1) or VARCHAR(x). That's not a good idea, but if that's what you have then perhaps the value in that column is something different than you are expecting (like Y or N) and thus you wouldn't get a match in the where clause.