Inverse logical (bit) value in SQL CE select statement

I am trying to write a query that gets table information from a database SQL CE, ready to be installed in C #, and then exported to XML. I need one of the columns named IDENT with a boolean value (to represent if this is really an identity column).

To do this, I check if the AUTOINC_SEED column is zero:

select isnull(AUTOINC_SEED) as IDENT from information_schema.columns

However, this returns TRUE for non-identity columns and FALSE for identity columns! Is there a way to change the boolean value inside the select statement?

Editing: I know what a case statement could do to solve this particular problem, but I was curious about inverting Boolean (bit) values ​​in SQL.

+5
source share
1

(^) SQL Server OR.

1 ^ 1 0, 1 ^ 0 1, :

SELECT (1 ^ [YourBitColumn]) as InverseBit

SQL CE, , SQL CE, , , , :

select (1 ^ AUTOINC_SEED) as IDENT from information_schema.columns
+12

All Articles