Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Posts
    2

    Arrow Unanswered: Sql Server Agent Status

    HI Guys,


    Can you help us on, how to start the SQLSERVERAGENT and

    how to know programatically is SQLSERVERAGENT is started or not in

    VISUAL BASIC.

    Thank you.

  2. #2
    Join Date
    Sep 2003
    Location
    Portland, Oregon
    Posts
    11

    Re: Sql Server Agent Status

    Originally posted by nehru
    HI Guys,


    Can you help us on, how to start the SQLSERVERAGENT and

    how to know programatically is SQLSERVERAGENT is started or not in

    VISUAL BASIC.

    Thank you.
    This does not exactly answer your question, but might help.

    To programmatically test to see if SQL Server Agent is running:

    Code:
    IF NOT EXISTS (
        SELECT 1
        FROM master.dbo.sysprocesses
        WHERE program_name = N'SQLAgent - Generic Refresher'
    ) BEGIN
        PRINT N'The SQL Server Agent process is not running.'
    END
    ELSE BEGIN
        PRINT N'The SQL Server Agent process is running.'
    END
    This code works on both SQL Server 7 and SQL Server 2000. However, it is undocumented.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •