SQL SERVER - Toogle a value

update <TABLE> set <col_1> = <col_1> ^ 1
For toogling a bit value in a update :
You need to do a EXCLUSIVE-OR on its value.
SQL SERVER offer you this feature '^'

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.