I have i temp table as
CREATE TABLE #TEMP (ID INT)
In this temp table i would be having 2 or more than 2 records. They would be necessarily 0 or 1 value.
Suppose if any one of the present value in temp table is 1 then i have to set a variable(Say the variable is @var) to 1. If all the records in the temp table are 0 then i have to set a variable(@var) value as 0.