I want to run a test on a certain table to see if a value exists:
IF EXISTS
((SELECT 1 FROM MTDC_ADMIN..DBAvailabilityAlert
WHERE InstanceName like @instancename AND FailedFlag like 'F') >=1)
IF the value is 1 as above, I want the job step to end with Success
IF the value is anything other than 1 I want the job step to end with Failure.
Then I can point the job toward the next appropriate step.
Unfortunately the job reports success no matter what the value.
Is there any way to pass an exit code to SQL Server?
FWoolverton