Tips and solutions

Task #1. I want to write notification to log if my SQL server is not available.
Solution:

  1. Create an event definition with a connection to required server and database.
  2. Specify SQL statement that will be executed successfully while the server is available. For example: select 1;
  3. Select interval between checks (10 minutes, for example) and "Infinite" execution type.
  4. Select "SQL statement executed failed" as a condition.
  5. Use "Write to log" option as an action. Enter something like "My server is down".

During execution, the program will write entered message with date and time to ERROR.LOG file when specified server could not execute SQL statement.

Task #2. I've two databases Test1 and "AllData". I want to execute my stored procedure CheckT1 in Test1 once per hour and only when number of rows in table T1 in "AllData" greater than 12.
Solution:

  1. Create an event definition with a connection to required server and "AllData" database.
  2. create SQL statement for event definition: "select count(*) from T1"
  3. Specify 1 hour as interval between checks.
  4. For condition, you should use "Result > 12"
  5. At the action page select "Execute SQL" and specify the connection to "Test1" database.
  6. Enter "call CheckT1" as SQL statement for action.

Task #3. I want to add a new row five times per hour to my SQL Server table.
Solution:

  1. Create an event definition with a connection to required server and database.
  2. Specify required INSERT statement at event definition tab.
  3. Select 20 minutes as the interval between checks.
  4. Use "Unconditional" and "No action" at related tabs.