• GilaMonster - Tuesday, January 9, 2018 7:34 AM

    Sue_H - Tuesday, January 9, 2018 7:20 AM

    GilaMonster - Tuesday, January 9, 2018 7:05 AM

    Sue_H - Tuesday, January 9, 2018 6:44 AM

    With dm_db_index_physical_stats, specifying default, null or 0 uses the current database.

    NULL, 0 or DEFAULT returns data for all databases on the instance.
    https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-db-index-physical-stats-transact-sql

    I should have qualified - current database in that script. But it's just the join later that will limit that - as you previously mentioned.
    Sorry didn't know why you referenced that at first or how its more efficient but now I get what you were saying - thanks.

    Sue

    Sorry, should have been clearer in the initial comment.

    Not really....duh on me. But I'm in the states, it's early and the coffee is too weak. Brain just needed to be nudged.