I have a regular table in SQL Server 2012 and I want to sort the data in a certain query by creation date of the records.
The problem is I don't have a column that holds this data for each record.
Is there a way of doing that without the designated column?
Maybe there is some kind of a built-in creation date information that exists in the database and I can access it somehow...
If you don't have a date column, you cannot sort by created date. There is no built-in create date per row that I know of. You have some other options though. If you have an identity column (auto increment), you can order by that to find which row was added first.
You could perhaps use the location of the row in data pages like this answer mentions: Equivalent of Oracle's RowID in SQL Server
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With