How to get the latest datetime update on Sql Server 2005?

Is there a way to get the latest datetime table date on Sql Server 2005? Preferably without creating triggers.

And for databases?

EDIT. In solving this issue, only modifications of CREATE and ALTER are considered. For INSERT, UPDATE and DELETE, see my next question

+1
source share
2 answers

this will display all types of objects from the most recent change to the oldest, you can easily change as needed ...

DECLARE @SearchParams   varchar(500)
SET @SearchParams='yourObjectName'

SELECT
    CONVERT(varchar(23),modify_date,121) AS modify_date
        ,type_desc
        ,name
    FROM sys.objects
    WHERE is_ms_shipped=0 AND name LIKE '%'+@SearchParams+'%'
    ORDER BY modify_date DESC

If you just want tables, try:

DECLARE @SearchParams   varchar(500)
SET @SearchParams='YourTableName'
SELECT
    CONVERT(varchar(23),modify_date,121) AS modify_date
        ,type_desc
        ,name
    FROM sys.objects
    WHERE type='U'
        AND name LIKE '%'+@SearchParams+'%' --can use "=@SearchParams" if you have the entire table name
    ORDER BY modify_date DESC
+1
source

KM , ( ) . , ( , , ). , - , - 1%, - .

+1

All Articles