How to retrieve the size of a database in restoring mode

Posted by Marc Wittke on Super User See other posts from Super User or by Marc Wittke
Published on 2011-11-24T09:24:28Z Indexed on 2011/11/24 10:04 UTC
Read the original article Hit count: 273

Filed under:

With pure SQL - how to do it?

I doubt it is possible, since even the SQL Management Studio fails to show the size of such a database in the UI.

Already tried:

exec sp_helpdb 'DbInRecMode'

...won't show anything;

exec sys.sp_helpfile 'DbInRecMode'

... something like file not found (Msg 15325)

Main pitfall seems to be the issue, that

select * from DbInRecMode.dbo.sysfiles

won't work when the database is in restoring mode. Any ideas?

© Super User or respective owner

Related posts about sql-server