Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

growth db Expand / Collapse
Author
Message
Posted Wednesday, October 22, 2008 1:19 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, October 22, 2008 8:55 AM
Points: 1, Visits: 8
hi

--select * from tbl_database_detail_excel1 --- this is my table

create procedure database_growth
as
begin

declare @dbname nvarchar(1000)
declare @db nvarchar(100)

declare c1 cursor for


/*select database_name,server_name, database_size, datafie_size, logfile_size, datafile_location, logfile_location
into #backupinfo
from tbl_database_detail_excel1 */

select database_name,server_name, database_size, datafie_size, logfile_size, datafile_location, logfile_location from tbl_database_detail_excel1
open c1



FETCH c1 into @dbname
WHILE @@FETCH_STATUS >= 0
BEGIN


select @db = 'select ' + '''' + @db + '''' + ', name, ceiling((size * 8192.0)/(1024.0 * 1024.0)), case when status & 0x100000 = 0 then convert(varchar,ceiling((growth * 8192.0)/(1024.0*1024.0))) + '' MB''' + char(10)+char(13)
+ 'else convert (varchar, growth) + '' Percent''' + char(10)+char(13)
+ 'end' + char(10)+char(13)
+ 'from [' + @db + '].dbo.sysfiles'


exec (@db)
fetch c1 into @db
end
close c1
end



when i exceute this sp, the error shows "Invalid object name 'database_growth' ". so please do something for me to resolve this problem.
Post #589623
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse