我正在尝试检查 Azure synapse studio 中表索引的碎片 有查询
SELECT
DB_NAME(ips.database_id) AS DatabaseName,
OBJECT_NAME(ips.object_id) AS TableName,
si.name AS IndexName,
ips.avg_fragmentation_in_percent
FROM
sys.dm_db_index_physical_stats(DB_ID(), NULL, NULL, NULL, 'LIMITED') ips
INNER JOIN
sys.indexes si ON ips.object_id = si.object_id
但由于某种原因我不断收到错误:
Incorrect syntax near 'DB_ID'.
并且不明白为什么。有什么建议吗?
Azure Synapse Analytics 中不提供 sys.dm_db_index_physical_stats 函数。