Ungültiges Kommando: Deadlock found when trying to get lock; try restarting transaction: INSERT INTO tmpCollection ( PType, PId, PIds ) SELECT DISTINCT CONVERT('pnf' USING UCS2) AS T, U.P, U.PI FROM ( SELECT 587 AS P, PersonRelations.PId2 AS PI FROM (PersonRelations INNER JOIN tmpCollection ON PersonRelations.PId1 = tmpCollection.PIds) LEFT JOIN (SELECT tmpCollection.PIds FROM tmpCollection WHERE tmpCollection.PId=587 AND tmpCollection.PType= CONVERT('pnf' USING UCS2) ) AS tmp ON PersonRelations.PId2 = tmp.PIds WHERE PersonRelations.RelationType=1 AND tmpCollection.PId=587 AND tmpCollection.PType= CONVERT('pnf' USING UCS2) AND tmp.PIds Is Null ) AS U Geor