Is TimeStamp column unique?

后端 未结 3 1683
别跟我提以往
别跟我提以往 2021-01-18 07:07

Is TimeStamp unique in all rows?

Does it have a unique index on it?

3条回答
  •  离开以前
    2021-01-18 07:43

    The docs says

    unique binary numbers within a database

    But in practice you can run into situations where this statement is not true. Since the value is generated from a database global counter you might run into problems when restoring databases and or using timestamp in tables in tempdb.

    You can see the next value:

    Select @@DBTS
    

    Until SQL Server 2000 there was an undocumented command to change the value

    DBCC CHECKDBTS (dbId, newTimestamp)
    

    To change the timestamp in non ancient verswions of SQL server see this answer:

    https://dba.stackexchange.com/a/11088/149485

提交回复
热议问题