According to your request, I assume that the active field is bit or int (assuming the int field has only 0 , 1 , or NULL ). In this case, I believe that you can write the query as follows:
UPDATE dbo.copyprogmaster SET active = active ^ 1 WHERE source = 'Mass_Mail'
Please note that the request can process NULL values, as well as lines # 1 , # 4 and # 6 in the screenshot. without changes. Screenshot # 1 shows the structure of the table and screenshot # 2 shows an example of the execution of the above query.
Hope this helps.
Screenshot # 1:

Screenshot No. 2:

user756519
source share