Ecco una risposta che ho trovato su SQLServerCentral.com. Ci sono un paio di script diversi forniti da utenti diversi in questa pagina. Forse uno di loro fornirebbe quello che stai cercando.
http://www.sqlservercentral.com/Forums/Topic670489-146-1.aspx
Ecco uno degli script da MANU-J:
Create TABLE #db_file_information(
fileid integer
, theFileGroup integer
, Total_Extents integer
, Used_Extents integer
, db varchar(30)
, file_Path_name varchar(300))
-- Get the size of the datafiles
insert into #db_file_information
(fileid
, theFileGroup
, Total_Extents
, Used_Extents
, db
, file_Path_name)
exec sp_MSForEachDB 'Use ?; DBCC showfilestats'
-- add two columns to the temp table
alter table #db_file_information add PercentFree as
((Total_Extents-Used_Extents)*100/(Total_extents))
alter table #db_file_information add TotalSpace_MB as
((Total_Extents*64)/1024)
alter table #db_file_information add UsedSpace_MB as
((Used_Extents*64)/1024)
alter table #db_file_information add FreeSpace_MB as
((Total_Extents*64)/1024-(Used_Extents*64)/1024)
select * from #db_file_information
drop table #db_file_information
fonte
2011-08-19 13:24:28
Questo è esattamente quello che stavo cercando, grazie. Immagino che per SQL Server 2000 dovrò usare il codice che jennifer-s ha fornito, giusto? – olmed0
Grazie. Semplice e utile. –