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.
LVL 4
Pankaj ParmarAsked:
Who is Participating?
 
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.
0
 
VENKAT KOKULLASQL Server DBACommented:
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)]
,a.maxsize

FROM dbo.sysfiles a (NOLOCK)

Venkat Kokulla
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
Recommendation to close this question by accepting the above comments as solution.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.