Query sys.dm_db_index_physical_stats.
The column avg_fragmentation_in_percent is logical fragmentation if the row in question is for a clustered or nonclustered index, or extent fragmentation if the object in question is a heap.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability