I have a query that returns 0 records. If this query returns 1 record I would like to throw an error.
check for @@rowcount
Just for an example you can do something like:
if exists
(
select 1
)
begin
THROW 50000, 'Row Count is not ZERO', 1;
end