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 343 AS P, PersonRelations.PId1 AS PI FROM (PersonRelations INNER JOIN tmpCollection ON PersonRelations.PId2 = tmpCollection.PIds) LEFT JOIN (SELECT tmpCollection.PIds FROM tmpCollection WHERE tmpCollection.PId=343 AND tmpCollection.PType= CONVERT('pnf' USING UCS2) ) AS tmp ON PersonRelations.PId1 = tmp.PIds WHERE PersonRelations.RelationType=1 AND tmpCollection.PId=343 AND tmpCollection.PType= CONVERT('pnf' USING UCS2) AND tmp.PIds Is Null AND PersonRelations.PId2 <> 343 ) AS U