Last_Altered date from Information_Schema for Tables, Views, Idxs

  • The following query renders Last_Altered dates for programmabilty objects including stored procedures, functions, etc.

    Use my_database

    GO

    SELECT ROUTINE_NAME,ROUTINE_TYPE,CREATED,LAST_ALTERED

    FROM INFORMATION_SCHEMA.ROUTINES

    ORDER BY LAST_ALTERED DESC

    Is there a similar query I can use to identify Last_Altered dates for tables, views, indexes, etc?

    BT
  • I tend to use the following:

    USE [DBName]

    SELECT name AS ObjectName

    , modify_date AS ModifiedDate

    , type AS ObjectType

    , type_desc AS TypeDescription

    FROM sys.all_objects

    More info on sys.all_objects is at: http://msdn.microsoft.com/en-us/library/ms178618.aspx

    There are also system catalog views specifically for tables, views, etc that have object specific info.

    Hope that helps,

    Randy

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply