I assume you are actually talking about sys.objects
view, and not sys.sysobjects
.
It seems like the modify_date
is set to create_date
until some other changes to table are made (which is pretty common pattern). According to documentation, the modify_date
is:
Date the object was last modified by using an ALTER statement. If the object is a table or a view, modify_date also changes when an index on the table or view is created or altered.
This would also mean that (for example) inserting and updating data does not count - only changes to the structure of table (well, and indexing).
Demo (Fiddle):
DROP TABLE IF EXISTS MyTable;
CREATE TABLE MyTable (Id INT);
SELECT
'after CREATE',
[name],
create_date,
modify_date,
[Same?] = IIF(create_date = modify_date, 'same', 'different')
FROM sys.objects
WHERE [object_id] = OBJECT_ID('dbo.MyTable')
/*Let's wait a bit, to make potential differences more obvious.*/
WAITFOR DELAY '00:00:05';
INSERT INTO MyTable(Id)
VALUES (1), (2);
SELECT 'after INSERT - does not change the modify_Date',
[name],
create_date,
modify_date,
[Same?] = IIF(create_date = modify_date, 'same', 'different')
FROM sys.objects
WHERE [object_id] = OBJECT_ID('dbo.MyTable')
ALTER TABLE MyTable
ADD [Name] VARCHAR(50);
SELECT 'after ALTER',
[name],
create_date,
modify_date,
[Same?] = IIF(create_date = modify_date, 'same', 'different')
FROM sys.objects
WHERE [object_id] = OBJECT_ID('dbo.MyTable')
sys.sysobjects
orsys.objects
? At least on my edition, thesys.sysobjects
does not containcreate_date
andmodify_date
columns - butsys.objects
does.