News

Copyright © 2008-2016 Paula DiTallo

Tag Cloud



SQL Server: How can I tell if a table is being used?

This statement will display the datetime stamp of the last user scan and the last user update. It will also include the # of user updates on that table.

SELECT OBJECT_NAME(OBJECT_ID) AS DatabaseName, last_user_update,*
FROM sys.dm_db_index_usage_stats
WHERE database_id = DB_ID( 'yourDatabaseName')
AND OBJECT_ID=OBJECT_ID('yourTableName')
Thursday, January 5, 2017 10:15 PM

Feedback

No comments posted yet.


Post A Comment
Title:
Name:
Email:
Comment:
Verification: