Export (0) Print
Expand All
ABS
ALL
AND
ANY
AVG
bit
COS
COT
DAY
EXP
GO
IN
LEN
LOG
MAX
MIN
NOT
OR
PI
SET
SIN
STR
SUM
TAN
USE
VAR
Expand Minimize

STATS_DATE

SQL Server 2000

Returns the date that the statistics for the specified index were last updated.

Syntax

STATS_DATE ( table_id , index_id )

Arguments

table_id

Is the ID of the table used.

index_id

Is the ID of the index used.

Return Types

datetime

Remarks

System functions can be used in the select list, in the WHERE clause, and anywhere an expression is allowed.

Examples

This example returns the date of the last time that the statistics were updated for the specified object.

USE pubs
GO
SELECT 'Index Name' = i.name, 
   'Statistics Date' = STATS_DATE(i.id, i.indid)
FROM sysobjects o, sysindexes i
WHERE o.name = 'employee' AND o.id = i.id
GO

See Also

System Functions

WHERE

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft