DanW's "Get Notified When Accounts Are Changed"

  • 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

  • This was removed by the editor as SPAM

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply