My question is this, after my first SELECT block executed I need to check @@ROWCOUNT if 0 then execute another SELECT block, how can I do that? Currently I am doing it but getting two table output first one has no or 0 rows and the second table is the one that I want.
if(@beta = 1)
BEGIN
SELECT * tblPages
WHERE bitActive = 1
END
if(@@ROWCOUNT = 0)
BEGIN
SELECT * tblPages
WHERE bitActive = 0
END
thanks in advance
1 Answer