How to find database size when it is offline in sql server

Scenario

Hi, Tech Giants! What new to me today? Yeah, We did a SQL Server migration activity or we can say a side-by-side up-gradation activity. From our DBA side, it’s almost done 90%, 10% percent is pending. We have some offline databases in our source server and the decision-making process is going between our big bosses. All of a sudden one of our big bosses asks the total size of all offline databases. Ohhh!! this task I have not done before !! I start googling and found two articles with two TSQL queries. But before googling I was thinking to go to the physical location of the database files and check the size of the files one by one. So I tried all three possibilities and the result shown below.

Query 1

The first article I found here at sqlservercentral.com

Result 1

Query 2

The second article I found here seniordba.wordpress.com

Result 2

And the third method is straightforward. I visit the physical location of the database files and check the size of the files one by one.

Facebook Comments Box

Comments

Leave a Reply

Your email address will not be published.