• francesco.mantovani - Thursday, January 11, 2018 1:02 PM

    The query always returns me an error,

    I try with 

     USE master
    USE DBNAME
    USE HelloWorld


    (I have a database called HelloWorld) :

    It always returns me

    Msg 2521, Level 16, State 40, Line 3 Could not find database ID 70. 


    Like there was no database

    That's the error I mentioned in an earlier post - if you look at the script, the database id is hard coded in dm_db_index_physical_stats. Replace 70 with DB_ID()

    Sue