I have a situation where I need to find out the most recent entry written to a table but the person who developed the database created the table without a DateTime field or an auto-incrementing ID field.
I am wondering is there any way of accessing some built in DateTime proprty recorded by SQL Server or any other way of determining the more recent entry out of say two results like this:
idp_fund_id IDPID
14 1653
18 1653
Below is the structure
CREATE TABLE [dbo].[web_IDP_Lifestyle](
[idp_fund_id] [int] NOT NULL,
[IDPID] [int] NOT NULL,
CONSTRAINT [PK_web_IDP_Lifestyle] PRIMARY KEY CLUSTERED
(
[idp_fund_id] ASC,
[IDPID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
In short: no.
You might be able to compare for existence of those values in backups… depending on how far the backups go.
I’m assuming that the idp_fund_id of 18 might have been written before the value of 14?