I have an SQL Job which takes two values out of a table and merges them together. After the merge, these two values are deleted.
If the table is empty, the Job produces Error-Messages. How can i prevent this?
Kind regards
I have an SQL Job which takes two values out of a table and merges them together. After the merge, these two values are deleted.
If the table is empty, the Job produces Error-Messages. How can i prevent this?
Kind regards
You would add a condition to check for an empty table:
if exists (select 1 from t)
begin
-- the merge code or procedure call here
end;