• Ratheesh.K.Nair (7/8/2014)


    Thanks Sean,

    The table name is put just for name sake and will be changed.

    No problem there.

    CreatedBy

    ModifiedBy are referring to other tables where they are PKEY and data type GUID.

    This is exactly what I was saying. These seem to be a FK to other tables with similar guids as a clustered key issue. Also, please consider my comments about why this might be an issue.

    If you allow a user to be deleted (and you have established a FK relationship to this table) SQL will not allow the delete of the user row. This could be a big problem. Then consider what happens when you don't establish a foreign key. You are left with a totally useless guid in a column that would tell you who created/modified the row, except that you can't tell anymore because the user was deleted. For me these types of auditing columns are an acceptable place to denormalize your data. I would recommend putting in the user name instead of a foreign key.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/