i have a stored procedure trying to do the following:
SELECT field1, field2, field3...
WHERE id = @id
Field1 = 1
Field2 = 0
Field3 = 1
Field4 = 0
If the field has a value of 1 Then I want to add that field # to my input into the next table
SET combinedvalue = @values
WHERE id = @someid
in this case, @values should equal 13 (because both field1 and field3 have values of 1)
Thanks in advance.