I'm running SMO 10.0.0.0 from Powershell against a SQL 2005 instance and generally issue the following query (with the results shown below):
c:\> $ss = New-Object "Microsoft.SqlServer.Management.SMO.Server" "myhost\myinst"
If log into that server with SQL Server Management Studio and click on Properties for tempdb, select files, the Size field is shown as 64 (M)
However!! if I issue the query below in SSMS, I get a different result. grr.....
so what happens is at some point I try to issue something like:
ALTER DATABASE [tempdb] MODIFY FILE(NAME='templog',SIZE=112875KB)
Msg 5039, Level 16, State 1, Line 1 MODIFY FILE failed. Specified size is less than current size.
which obviously fails since my measurement of file size was errorneous. this is really not good. thoughts anyone?
p.s. incidentally, if I look at the actual file, its size is correctly stated by sp_helpdb, so SMO is wrong!!
View Complete Post