Search code examples
sql-job

Select Statements in Jobs


I have inherited a few jobs and I am trying to understand why select statements would be in their steps. I would think that select statements would be pointless in an automated job that displays nothing for an end user.


Solution

  • It's hard to know why without seeing the code, but I can take a guess...

    Perhaps it is a SELECT ... INTO ... statement where the results are stored in another table.

    Another alternative might be just to test that the service is running correctly. If the select fails an exception might be thrown and this might be caught elsewhere to notify someone that there is a problem.