I ran into a little problem where I wanted to check a flag in a table to see if the sql job should be run or not.
I'm not sure if it's the right way or the nicest way to do this, but it works.
In the first step do:
if (SELECT count(*) FROM update WHERE ) = 0beginRAISERROR( 'Not ready to update.' , 16, 1 )end
Got the syntax from this tread http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/Q_23094297.html
Set the On success to Goto next step (as default) to proceed with following job steps. You could set the On failure to Quit with success to avoid the errors in the history since it's an expected error that is raised.
Inga kommentarer:
Skicka en kommentar