--FOR DATABASE GROWTH REPORT
use master
go
create table #grow1(database_name varchar(250),
database_size float,remarks varchar(150));
insert #grow1 exec('exec sp_databases');
select database_name,round(database_size/1024,2) as 'MB',
round((database_size/1024)/1024,2) as 'GB',
remarks from #grow1;
drop table #grow1
GO
--FOR HARD DRIVE FREE SPACE
create table #space1(drive varchar(10),free_space float);
insert #space1 exec('exec.master.dbo.xp_fixeddrives');
select Drive ,free_space as 'MB ',round (free_space/1024,2) as 'GB' from #space1;
drop table #space1
use master
go
create table #grow1(database_name varchar(250),
database_size float,remarks varchar(150));
insert #grow1 exec('exec sp_databases');
select database_name,round(database_size/1024,2) as 'MB',
round((database_size/1024)/1024,2) as 'GB',
remarks from #grow1;
drop table #grow1
GO
--FOR HARD DRIVE FREE SPACE
create table #space1(drive varchar(10),free_space float);
insert #space1 exec('exec.master.dbo.xp_fixeddrives');
select Drive ,free_space as 'MB ',round (free_space/1024,2) as 'GB' from #space1;
drop table #space1
No comments:
Post a Comment