I didn't see a way to email DanW, a way to add comments nor a forum here for Scrip Library followups...
His script needs to test the databases for Updateablity and Status so it doesn't try and modify OffLine and Read_only databases. Otherwise his script doesn't run.
New lines of code is preceeded with ">>"
declare c1 cursor fast_forward for select name from master..sysdatabases
open c1
fetch next from c1 into @sDBName
while @@fetch_status = 0
begin
>>if databasepropertyex ( @sDBName, 'STATUS' ) = 'OFFLINE' or databasepropertyex ( @sDBName, 'Updateability' ) = 'READ_ONLY'
>>goto skipthisdb
.
.
.
.
end
>>skipthisdb:
fetch next from c1 into @sDBName