• (nodebb)

    I half-suspect that's auto-generated code. The rule says "When connecting two tables, make sure there's a FK constraint between them so there can't be orphan records". So when the dumb SQL generator code was told to connect table A to table A, it mindlessly added the appropriate FK constraint.

    But where's the fun in that? Better to think it was a clueless self-taught noob. Or more likely somebody who took, passed, but understood none of, Databases 201.

  • (nodebb) in reply to WTFGuy

    I agree on the autogenerated but I think this is probably the result of someone accidentally dragging the PK column while using a table/diagram designer like the one that has been included with SSMS since forever, the same one that produces names like PK__Configur__F6E145D05992BA46 and DF__Configura__KtCal__7F23583C.

  • Hmmmm 🤨 (unregistered)
    Comment held for moderation.

Leave a comment on “Only Create Me if I Exist”

Log In or post as a guest

Replying to comment #705951:

« Return to Article