Hugo Kornelis (4/24/2013)
Very good, and very clever question. Well done! 😉
I will totally second this statement. I sat there staring at the question...
I could rule out row one because it references row 2, which didn't exist yet
Row 2... referenced row 1... which the identity was used up due to the failed insert, but the failed insert meant that it too would fail
Finally row 3... was sneaky... ultimately I "went with it" and decided that it would insert... In all of what I've done, I've never tried to insert into a self referencing table a row that references itself, but I could see where that might be necessary (making the CEO report to himself in the company hierarchy instead of setting the identity of the employee he reports to, to null for example).
Thanks for making my brain have to work this morning!