--
--  File:     CHECK_INDEX_FRAGMENTATION.SQL
--	
--

USE tpch3000gcci
GO

DECLARE	@dbid		smallint

SELECT @dbid	= DB_ID()

PRINT   '*** CUSTOMER ***'
SELECT  *
FROM    sys.dm_db_index_physical_stats(@dbid, OBJECT_ID(N'CUSTOMER'), NULL, NULL , 'LIMITED')

PRINT   '*** LINEITEM ***'
SELECT  *
FROM    sys.dm_db_index_physical_stats(@dbid, OBJECT_ID(N'LINEITEM'), NULL, NULL , 'LIMITED')

PRINT   '*** NATION ***'
SELECT  *
FROM    sys.dm_db_index_physical_stats(@dbid, OBJECT_ID(N'NATION'), NULL, NULL , 'LIMITED')

PRINT   '*** ORDERS ***'
SELECT  *
FROM    sys.dm_db_index_physical_stats(@dbid, OBJECT_ID(N'ORDERS'), NULL, NULL , 'LIMITED')

PRINT   '*** PART ***'
SELECT  *
FROM    sys.dm_db_index_physical_stats(@dbid, OBJECT_ID(N'PART'), NULL, NULL , 'LIMITED')

PRINT   '*** PARTSUPP ***'
SELECT  *
FROM    sys.dm_db_index_physical_stats(@dbid, OBJECT_ID(N'PARTSUPP'), NULL, NULL , 'LIMITED')

PRINT   '*** REGION ***'
SELECT  *
FROM    sys.dm_db_index_physical_stats(@dbid, OBJECT_ID(N'REGION'), NULL, NULL , 'LIMITED')

PRINT   '*** SUPPLIER ***'
SELECT  *
FROM    sys.dm_db_index_physical_stats(@dbid, OBJECT_ID(N'SUPPLIER'), NULL, NULL , 'LIMITED')
GO
