The last statistics update is null, and now?

Miguel Gavinhos 216 Reputation points
2021-10-22T14:03:27.403+00:00

Why is StatisticsUpdatedate is null? How to fix it ?

The script is :

SELECT *, OBJECT_NAME(object_id) AS [ObjectName]
,[name] AS [StatisticName]
,STATS_DATE([object_id], [stats_id]) AS [StatisticUpdateDate]
FROM sys.stats;

Best regards,
Miguel

Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,535 questions
0 comments No comments
{count} votes

Accepted answer
  1. Miguel Gavinhos 216 Reputation points
    2021-10-23T16:38:47.407+00:00

    I can observe that user tables without records get StatisticUpdateDate = null, but I have user tables with records that StatisticUpdateDate = null.


2 additional answers

Sort by: Most helpful
  1. Tom Phillips 17,716 Reputation points
    2021-10-22T14:25:31.443+00:00

    That is perfectly normal. It just means the stats have not been updated since they were created.

    Are you having an issue of some kind?

    0 comments No comments

  2. Miguel Gavinhos 216 Reputation points
    2021-10-22T19:42:38.227+00:00

    It looks by design, and I can see that I have a bunch of user tables with a persistent statistics update date = 'null' that by no method can I get it changed from null to a date. I'm not saying that it is always or never I have no data to support this statement. The methods are https://ola.hallengren.com/sql-server-index-and-statistics-maintenance.html and sp_MSforeachdb 'use [?]; exec sp_updatestats'. I'm I missing something?