SQL Server da Tüm kullanıcı veritabanlarının boyutlarını görüntülemek aşağıdaki adımları uygulayabilirsiniz.
use master declare @PageSize varchar(10) select @PageSize=v.low/1024.0 from master..spt_values v where v.number=1 and v.type='E' select name as DatabaseName, convert(float,null) as Size into #tem From sysdatabases where dbid>4 declare @SQL varchar (8000) set @SQL='' while exists (select * from #tem where size is null) begin select @SQL='update #tem set size=(select round(sum(size)*'+@PageSize+'/1024,2) From '+quotename(databasename)+'.dbo.sysfiles) where databasename='''+databasename+'''' from #tem where size is null exec (@SQL) end select DatabaseName as 'Veritabani Adi',Size as 'Boyut (MB)' from #tem order by DatabaseName drop table #tem
veya
select db_name(database_id) as Veritabani,sum(size)*8/1024 [Size (MB)] from sys.master_files where database_id>4 group by db_name(database_id)