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.
+1
A:
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.
Mark Byers
2010-05-17 15:28:14
Crap you're correct. I was looking for into statements before and missed them.Would there be a reason why a vanilla select statement would ever be used in a job?
Andrew Vogel
2010-05-17 15:31:37
@Andrew Vogel: Heh, lucky guess. I've updated my comment with an answer that would also apply to a select without an into clause: for some monitoring service with error notificiation.
Mark Byers
2010-05-17 15:35:05
Thanks Mark. I appreciate your help.
Andrew Vogel
2010-05-17 15:58:02