My query looks like:
SELECT *
FROM
(
SELECT *
FROM Server1
UNION
SELECT *
FROM Server2
)
Now, I have the options for the subquery:
- only server 1
- only server 2
- both server 1 and 2
I was thinking of having a parameter in my stored procedure that would perform a bitwise operation on the parameter to tell me if I need option 1, 2, or 3.
Is this possible? Is there a better way?