devxlogo

Using sys.dm_db_index_physical_stats

Using dm_db_index_physical_stats?returns size and fragmentation information for the data and indexes of the specified table or view in SQL Server.

USE master;  GO  -- If Student.Name does not exist in the database, the function returns NULL.  -- If NULL is specified as an OBJECT_ID, all objects in the database are returned.  SELECT * FROM sys.dm_db_index_physical_stats      (DB_ID(N'AdventureWorks'), OBJECT_ID(N'Student.Name'), NULL, NULL , 'DETAILED');

Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.