|
|
Finding unused objects
Using the following DMV I get to know which of the objects in the DB is in use
dm_exec_trigger_stats, dm_exec_procedure_stats, dm_db_index_usage_stats
Is there a DMV to have this data about a View?
|
|
0
|
|
|
|
Reply
|
Utf
|
9/12/2010 8:03:48 AM |
|
Gal (Gal@discussions.microsoft.com) writes:
> Using the following DMV I get to know which of the objects in the DB is
> in use dm_exec_trigger_stats, dm_exec_procedure_stats,
> dm_db_index_usage_stats
> Is there a DMV to have this data about a View?
If you want to know which are the unused procedures:
SELECT o.name
FROM sys.objects o
WHERE o.type = 'P'
AND NOT EXISTS (SELECT *
FROM sys.dm_exec_procedure_stats ps
WHERE ps.database_id = db_id()
AND ps.object_id = o.object_id)
But beware! Just because a procedure is not in the cache does not mean that
it is unused. It may be a procedure used by an end-of-month report, for
instance.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
|
|
0
|
|
|
|
Reply
|
Erland
|
9/12/2010 9:14:41 AM
|
|
|
1 Replies
1069 Views
(page loaded in 0.035 seconds)
Similiar Articles: Finding unused objects - microsoft.public.sqlserver.server ...Using the following DMV I get to know which of the objects in the DB is in use dm_exec_trigger_stats, dm_exec_procedure_stats, dm_db_index_usage_stat... The Indexing Service query cannot be completed successfully ...I'm trying to do a search for *.txt files containing a certain phrase and am unable to do so. When I try I get the following message: Search Comp... microsoft.public.sqlserver.serverFinding unused objects Utf 1 661 Using the following DMV I get to know which of the objects in the DB is in use dm_exec_trigger_stats, dm_exec_procedure_stats, dm_db_index ... Statistics on SQL 2005 - microsoft.public.sqlserver.server ...Finding unused objects - microsoft.public.sqlserver.server ..... of the objects in the DB is in use dm_exec_trigger_stats ... -- Erland Sommarskog, SQL Server MVP ... get array from html - microsoft.public.scripting.vbscript ...I did not find an example of a way to convert > an arbitrary JS array into ... Finding unused objects - microsoft.public.sqlserver.server ... Using the following DMV I get to ... Which query is being used by which form/report? - microsoft.public ...Finding and Deleting Unused Objects and Code in Microsoft Access ... First of all, a table, query, form, report, or macro can be used interactively from the ... while it's ... Insert Paste - microsoft.public.excel.worksheet.functions ...To correct thing select all 'unused' columns to the right of your data and 'delete ... sheet can some one tell me why I am getting this > message " Cannot Shift Objects ... How to save a picturebox's image to a .PNG file? (VB6 ...Finding an OCX/DLL would probably be a lot easier, and ... functions are part of the interface for these objects. ... in most people's work after a while - removing unused ... Default namespace, prefix and XDocument - microsoft.public.dotnet ...Remove unused xmlns namespaces from an XmlDocument ... 2147024809 (80070057)':+ > WSDLReader:Could not find ... sqlserver.programming ..... holds a group of objects, and ... BSOD-Unmountable & others - microsoft.public.windowsxp.general ...>> I have also been trying to find what is meant by 'A devise enclosed in ... to the Windows XP settings, > accessible by: > > (right-clicking on an unused area ... How to find unused Objects? - Microsoft Corporation: Software ...Is there a way in SQL I can tell when the last time a stored procedure was run or a table was accessed? I know there are a lot of objects in my system that ... Finding and Deleting Unused Objects and Code in Microsoft Access ...Finding and Deleting Unused Access Objects and Code How Unused Objects and Code Get Created. It's very easy to create objects in a Microsoft Access database whether ... Ask Tom "Unused OBJECTS"At least PLEASE help me in finding unused TABLES.For other objects I'm thinking to check manually in the application code(using find and grep commands) Please ... Finding unused objects - microsoft.public.sqlserver.server ...Using the following DMV I get to know which of the objects in the DB is in use dm_exec_trigger_stats, dm_exec_procedure_stats, dm_db_index_usage_stat... Find Unused Objects in your SQL Server DatabaseThis query wont give you a list of unused objects. It gives you a list of used objects which you need to keep track for some time and see if any of the objects are ... 7/27/2012 9:12:38 PM
|
|
|
|
|
|
|
|
|