sql server agent alert failed

Ahmed Al Mohalami 0 Reputation points
2024-05-29T07:47:16.79+00:00

hello

I have this problem with my SQL Server Agent, the service is working properly but when I make alert by some program running by SQL Server it shows that SQL Server agent is not working even if it is working, where should the problem be?User's image

SQL Server | Other
{count} votes

2 answers

Sort by: Most helpful
  1. Erland Sommarskog 121.9K Reputation points MVP Volunteer Moderator
    2024-05-29T21:51:11.7333333+00:00

    So the job you are trying to run has a syntax error somewhere. If you don't know anything about what's in the job, you need to find someone who knows about the job and who can fix the problem.

    And mind you, SQL Server Agent is working. It's doing what is being told do. That is, it attempts to run SQL code that is syntactically incorrect. Not surprisingly, the job will fail, but that is not a problem with Agent.

    1 person found this answer helpful.

  2. Anonymous
    2024-05-29T09:41:55.0733333+00:00

    Hi @Ahmed Al Mohalami,

    Thanks for your information.

    Based on the fragment of the error message, it looks like there is syntax error. Are you trying to run queries?

    The reason for the syntax error maybe the extraneous trailing comma, so you need to remove that comma and add a close parenthesis for valid syntax. If you are running some statements, you can also check out this article.

    NOTE: Never use string concatenation or interpolation to specify SQL statement values. Instead, always use parameters for those values. The SQL statement itself never changes, just the parameter value.

    Please feel free to share your issue here if you have any confused.

    Best regards,

    Lucy Chen


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    https://docs.microsoft.com/en-us/answers/support/email-notifications


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.