Microsoft SQL Server: Any way to tell when a record was created?

后端 未结 5 1844
暖寄归人
暖寄归人 2021-01-11 15:14

Our customer wants to order by the record creation date. To me this seems like a system variable, some sort of meta data for the record itself.

Is there a way to te

5条回答
  •  独厮守ぢ
    2021-01-11 16:00

    I once came with a kind of situation where order of the rows of a table is required but no timestamp (CreateDateTime, UpdateDateTime, ..., etc.) column is available. So, only data I had was the transaction log. Reading transaction log directly was not helpful as it is not easy to parse. Hence, I found a program called "ApexSQL Log" which was very helpful. It has all filtering options and you can read all log data without hardcore operations. Although this solution was satisfactory for me, it has a drawback: You can only filter date (Begin Time and End Time) according to transaction operation. If you are searching for a query operation, for example an insert, which is encapsulated in a transaction, you can not retrieve the exact insert time (at least I could not find a way), only the transaction time. If your operations are all atomic, then you can literaly have all row create date information.

提交回复
热议问题