vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| It's ugly, but you can do the following: update myTable set myField = case myField when 0 then 1 when 1 then 0 end Or you can write your own user-defined function: create function myNot(@v bit) returns bit as begin declare @r bit set @r = case @v when 1 then 0 when 0 then 1 end return @r end and use it like so: update myTable set myField = dbo.myNot(myField) Brannon "Michel" <iware_ext@hotmail.com> wrote in message news:#Mmt3tSiEHA.1048@tk2msftngp13.phx.gbl... > I'd like to do the following query > > update myTable set myField = not (myField) > > But it looks like not isn't a function. > How can I write this? > > Thank you > > |