這些table還有在用嗎?
怎麼取得Table最後一次異動日期?
如果有建索引,就可以用這個方法查閱
SELECT TOP 100 PERCENT TABLENAME,LASTUPDATED FROM
(
SELECT B.NAME AS 'TABLENAME', MAX(STATS_DATE (ID,INDID)) AS LASTUPDATED
FROM sys.sysindexkeys AS A
INNER JOIN sys.objects AS B ON A.ID = B.OBJECT_ID
WHERE B.TYPE = 'U' AND STATS_DATE (ID,INDID) IS NOT NULL
and B.NAME in ('ooo','xxx')
GROUP BY B.NAME
) AS A
order by LASTUPDATED desc