Re: [sqlalchemy] Bitwise Flag Type

2014-04-01 Thread Alex
Yeah, its a very frustrating aspect of SQL Server. Anyway, a query that works is the following: SELECT testmodel.id AS testmodel_id, testmodel.flags AS testmodel_flags FROM testmodel WHERE (testmodel.flags 1) 0 I can get sqlalchemy to emit this like so:

Re: [sqlalchemy] Bitwise Flag Type

2014-04-01 Thread Michael Bayer
On Apr 1, 2014, at 11:28 AM, Alex quixop...@googlemail.com wrote: Yeah, its a very frustrating aspect of SQL Server. Anyway, a query that works is the following: SELECT testmodel.id AS testmodel_id, testmodel.flags AS testmodel_flags FROM testmodel WHERE (testmodel.flags 1) 0 I

[sqlalchemy] Bitwise Flag Type

2014-03-31 Thread Alex Good
Hi there, I'm working with a database where the original designer has chosen to represent a large number of values as bitflags. Nearly every table in the database has a 'flags' integer which is bitwise ORred or ANDed with constants stored in the application code to extract the relevant

Re: [sqlalchemy] Bitwise Flag Type

2014-03-31 Thread Michael Bayer
On Mar 31, 2014, at 5:36 AM, Alex Good quixop...@googlemail.com wrote: Hi there, I'm working with a database where the original designer has chosen to represent a large number of values as bitflags. Nearly every table in the database has a 'flags' integer which is bitwise ORred or ANDed