If I right-click on a database in SQL Server Management Studio and look at the size of one of my DBs, I see 676.75.
If I run the following,
Get-SqlDatabase -name $DBName | select name,size
it returns 669.75. I’ve looked through the other Smo.Database object properties (Get-SqlDatabase -name $DBName | select *) and don’t see 676.75 anywhere, so I’m pretty confused at where it’s getting this number. This is a DB that grows every day, and since it was 676.75 on Friday, the higher number makes sense. I just can’t figure out where it’s getting it. I assumed the number displayed in the GUI would have just been pulled from the object property, but it appears I’m wrong.
I can’t find any resources talking about different size properties in SQL Server. Any help would be great. Thanks!
submitted by /u/cfmacd
[link] [comments]
The post SQL database size different in PowerShell than SQLSMS? appeared first on How to Code .NET.