0

I'm trying to create a table that uses some sort of timestamp as the ID column with PK. The goal is to create a table that can be sorted using the ID column which can be used to order the table using a numbering format searching according to the date and time the data was inserted. I know I can set the ID column using identity but I would like the column to be more useful. I'm hoping there is an efficient way of doing this which provides a performance gain. E.G. I know in excel you can put a date/time into a cell and it displays as a number depending on the format used.

Hope this is clear, I'm finding it hard to explain. Thanks,

Drewbert
  • 1
  • 1
  • 1
    Did you see this question? https://stackoverflow.com/questions/66575082/perform-insert-with-timestamp-that-increments – Dale K Mar 11 '21 at 03:28
  • 1
    And if you are seriously using SQL Server 2008 its time to upgrade. – Dale K Mar 11 '21 at 03:37
  • Thanks Dale, I've checked out the link you provided and will see if this can help me. In regards to 2008R2, I totally agree and have upgraded a majority of the instances. The ones left are the painful ones where work is still being done to the databases so they can be upgraded. – Drewbert Mar 11 '21 at 05:33

0 Answers0