Microsoft SQL Server: Generate a sequence number, per day

后端 未结 5 1938
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-06 12:22

I\'m tasked to create an increasing sequence number per day for a project. Multiple processes (theoretically on multiple machines) need to generate this. It ends up as

5条回答
  •  春和景丽
    2021-01-06 13:09

    If you don't mind the numbers not starting at one you could use DATEDIFF(dd, 0, GETDATE()) which is the number of days since 1-1-1900. That will increment every day.

提交回复
热议问题