Sue_H - Monday, January 8, 2018 3:02 PM
DB_ID() would probably be more efficient, since dm_db_index_usage_stats is scoped to the current DB.
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