In this blog I will explain you how to change the value of a bit
Recently, I had a scenario where I had to change the
value of a bit type column i.e wherever there were 1 in the column I had
to replace it with 0 and vice versa. After doing some searching I found
I did it with the help of Common Table Expression
Let's create a table and insert few records into it.
Now, lets add the record in the Common Table Expression.
As you can see in the above screen shot "0"'s are replaced with "1"s and vice versa.
There are other ways of doing it as well. But I found this easy to use and readable.
Do let me know your comments or feedbacks.