Value of last_user_update of all tables in sys.dm_db_index_usage_stats has become null after few days.
Please advise if this is correct behaviour.
CREATE FUNCTION [dbo].[ufnGetLastUpdatedDate]
(
-- Add the parameters for the function here
@Tablename varchar(100)
)
RETURNS datetime
AS
BEGIN
-- Declare the return variable here
DECLARE @lastupdated datetime;
-- Add the T-SQL statements to compute the return value here
SELECT @lastupdated = last_user_update FROM sys.dm_db_index_usage_stats WHERE OBJECT_ID=OBJECT_ID(@Tablename)
-- Return the result of the function
RETURN @lastupdated
END
GO