Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,557 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
A community member has associated this post with a similar question:
Querying table index stats not working
Only moderators can edit this content.
I try to get the fragmentation of my indexes with code
SELECT IPS.Index_type_desc,
IPS.avg_fragmentation_in_percent,
IPS.avg_fragment_size_in_pages,
IPS.avg_page_space_used_in_percent,
IPS.record_count,
IPS.ghost_record_count,
IPS.fragment_count,
IPS.avg_fragment_size_in_pages
FROM sys.dm_db_index_physical_stats(DB_ID(),NULL, NULL, NULL , 'DETAILED') AS IPS
How ever this gives me error
Parse error at line: 9, column: 40: Incorrect syntax near 'DB_ID'
Why does this not work?