I ran the query below which gives me statistics report about when it was last updated but for some reason some of the them returned null value.
Please can any one explain to me the reason for the null values?
Can this affect performance in any way? if yes
Please suggest resolution
Thanks
SELECT
DISTINCT
OBJECT_NAME
(s.[object_id])ASTableName,
c
.nameASColumnName,
s
.nameASStatName,
STATS_DATE
(s.[object_id],s.stats_id)ASLastUpdated,
DATEDIFF
(d,STATS_DATE(s.[object_id],s.stats_id),getdate())DaysOld,
dsp
.modification_counter,
s
.auto_created,
s
.user_created,
s
.no_recompute,
s
.[object_id],
s
.stats_id,
sc
.stats_column_id,
sc
.column_id
FROM
sys.statss
JOIN
sys.stats_columnssc
ON
sc.[object_id]=s.[object_id]ANDsc.stats_id=s.stats_id
JOIN
sys.columnscONc.[object_id]=sc.[object_id]ANDc.column_id=sc.column_id
JOIN
sys.partitionsparONpar.[object_id]=s.[object_id]
JOIN
sys.objectsobjONpar.[object_id]=obj.[object_id]
CROSS
APPLYsys.dm_db_stats_properties(sc.[object_id],s.stats_id)ASdsp
WHERE
OBJECTPROPERTY(s.OBJECT_ID,'IsUserTable')=1
AND
(s.auto_created=1ORs.user_created=1)
ORDER
BYDaysOld;