SQL server database size difference issue.

SQL server database size difference issue.

When we checked SQL database size using options, we found varying difference and need help to understand why this difference and which  size to consider as actual database size from SharePoint migration perspective as we need to consider database size as well when estimating project cost.

Please find below our observations. This is SharePoint Content database which stores documents, list items.

File explorer shows 104 GB (MDF)

From SQL SSMS shows 106.5 GB (MDF)

From STSADM shows 100.5 GB - This is SharePoint command to check database size.

From Content Matrix shows 105.3 GB - This value we got from migration tool.
Pankaj ParmarAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Vitor MontalvãoMSSQL Senior EngineerCommented:
It depends on what the tool is looking for the size.
Some tools giving the sum of file sizes (.MDF + .NDF + .LDF).
Others gives only the size of the data files (.MDF + .NDF).
Others the used space inside the files.
But SSMS should provide the total size of the files and you can drill down per file and check how much space is used per file.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
From DBA point of view we can consider the file size from SSMS itself.

Below script will help out to get exact size instead of checking from studio.

SELECT filegroup_name(groupid),Name, Filename,

CONVERT(Decimal(15,2),ROUND(a.Size/128.000,2)) [Currently Allocated Space (MB)],

CONVERT(Decimal(15,2),ROUND(FILEPROPERTY(a.Name,'SpaceUsed')/128.000,2)) AS [Space Used (MB)],

CONVERT(Decimal(15,2),ROUND((a.Size-FILEPROPERTY(a.Name,'SpaceUsed'))/128.000,2)) AS [Available Space (MB)]

FROM dbo.sysfiles a (NOLOCK)

Venkat Kokulla
Vitor MontalvãoMSSQL Senior EngineerCommented:
Recommendation to close this question by accepting the above comments as solution.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.