Write sql or something to hit multiple instances on same server to enable an alert.

  • I can use this to enable or disable this alert:

    USE msdb ;

    GO

    EXEC dbo.sp_update_alert

    @name = N'Severity 20 Error',

    @enabled = 1 ;

    GO

    But, I need to do this on about 8 instances on the server and some instances on our test server.

    How can I write a script to connect to the other instances or is there another recommendation.

    Need to do this about once a month before and after our security scans. thanks

  • I beleive below approach will help you:

    1. Pick a server where the job will run

    2. Add all other servers as linked server there

    3. Write your code for each server in a TSQL (Servername.dbname....) and then wrap them as a job

    4. Schedule the job

  • Thanks.. I was looking at linked servers as well. What I just did was create a bat file with several sqlcmd statements and that did the trick.

    thanks 🙂

  • Keith Knox (7/17/2008)


    Thanks.. I was looking at linked servers as well. What I just did was create a bat file with several sqlcmd statements and that did the trick.

    thanks 🙂

    Another option would be to use Powershell and SMO.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

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

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