本文介紹了SQL Server 中是否有函數/特性來確定表是否有任何(最近)活動?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我正在嘗試清理數據庫并想確定不再需要哪些表以便我可以刪除它們.
I'm trying to clean up a database and want to determine which tables are no longer needed so I can drop them.
(SQL Server 2000)
提前致謝!
推薦答案
是的 - 這樣的查詢應該會為您提供所需的信息:
Yes - a query such as this should give you the information you need:
SELECT
last_user_seek,
last_user_scan
FROM
sys.dm_db_index_usage_stats
WHERE
database_id = DB_ID() and object_id = object_id('tablename')
SQL 2000 更新:否 - 我相信在 SQL 2000 中沒有獲取這些信息的內置方式
Update for SQL 2000: No - I believe there's no built in way of getting this information in SQL 2000
這篇關于SQL Server 中是否有函數/特性來確定表是否有任何(最近)活動?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!