What Data Types To Use For GUIDs In Archive Table RRS feed

  • Question

  • I'm in the process of setting up Archive tables in our system.  For the most part I can copy the schema of the existing tables, but what data type(s) is/are recommended in my archive table for source data types such as "TimeStamp" and "UniqueIdentifier" if I want to keep the original values rather than having new values generated in the Archive table when inserting from the source table?

    • Moved by Tom PhillipsEditor Tuesday, February 16, 2010 9:17 PM Probably better Database Design question (From:SQL Server Database Engine)
    Tuesday, February 16, 2010 8:51 PM


  • For timestamp, which is a synonim for rowversion, you should use either binary(8) or varbinary(8). From BOL:
    A nonnullable rowversion column is semantically equivalent to a binary(8) column. A nullable rowversion column is semantically equivalent to a varbinary(8) column.

    You can continue using uniqueidentifier - the values will be preserved when you copy the data into archive tables.
    • Marked as answer by dgolds Friday, February 19, 2010 12:28 AM
    Thursday, February 18, 2010 8:58 PM