Hi to all.
I think the title "Monitoring File Sizes in SQL Server" is not completely correct.
When noticing this title I thought '"this is what I'm looking for" but it seems to measure the fixed filesize from a file location but not the actual filesize.
For one of our apllication I have to measure the actual filesize due to some unexpected growth and shrinking so I was looking for a way to retrieve these sizes from the database.(Files must be fixed according the application vendor)
The table "database.sysfiles" is not exact enough; This sys-table only contains the fixed filesize for each file but not the actual filling of this fixed size.
so I tried to write me a script to retrieve the actual filesize from the filesystem but unfortunately it retrieves the fixed size as well !!! ;-(
This script is far more easy to use for other purposses as the VBS / HTML script you suggesting in part 1 and part 2.
I hope you ( and others ) can use it in any way whatsoever;
create table #temp( col1 varchar(300))
insert into #temp exec master..xp_cmdshell' dir\\<servername>\<foldername>'
delete from #temp where ( col1 is null )
delete from #temp where ( col1 not like '%<discrimination on some file names>%' )
select substring(col1,charindex('MMS',col1,1),50) as XX_filename,
substring(col1,charindex('MMS',col1,1)-18,18) as XX_filesize
from #temp
drop table #temp
From here you can hook up any other TSQL script.
Regards,
GKramer
THe Netherlands