check db if in restore

  • Hi,

    I need to query the back up database, but when the backup is in restore i can't query it. Is their a way to check if the database is in restore. Basically, a store procedure run every 5 mins, if the database is in restore, I want the procedure to quit it self and run again in 5 mins.

     

    thanks

     

  • Glitch,

    You should look into the DATABASEPROPERTY function in BOL.

    SELECT DATABASERPROPERTY('dbname', 'IsInLoad')

    will return 1 if it is being restored, 0 otherwise.

    -- J.Kozloski, MCDBA, MCITP

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply