• If they can only ever be 0 or 1 then max will do the job, as if anything is set to 1 it will return 1 or if everything is 0 it will return 0

    SELECT @Var = MAX(ID) FROM #Temp