Can I use a SQL Server identity column to determine the inserted order of rows?

前端 未结 3 1093
一整个雨季
一整个雨季 2021-01-12 10:34

I need to be able to determine the order which rows have been inserted into a table (there are no updates). Can I use an identity column to do this? I know that there may be

3条回答
  •  悲&欢浪女
    2021-01-12 11:05

    Largely yes, as long as you don't ever reset it or insert rows with bulk copy, or use IDENTITY_INSERT. And of course assuming that you don't overflow the data-type (which could be impressive).

提交回复
热议问题