• timothyawiseman (1/22/2009)


    I'll agree with Grant, though there are some cases where it makes sense to have a column named Id in the base table and then the foreign keys referencing it may be named BasetablenameId.

    In general, it should be very obvious through names alone what the relations are.

    I've seen those designs. I've never been crazy about them. If you query more than one table and want to return the PK you then have to alias the PK names in the queries... It seems really sloppy to me. Worse yet, it requires extra work and I am lazy.

    I prefer naming something what it is and letting that thing live that way through the database and, if possible, throughout the enterprise.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning