Column Data Type for Bitwise Comparison?
I only use flags/bitmask fields in cases where a.) the flatness of the schema matters (data warehouse) and b.) I'm absolutely guaranteed to never pass 64 bits. If this is an OLTP system I'd refactor to use both a many to many mapping table to track the bits and a lookup table with flag names. The m2m table would have 2 fields: FK to the ID of the table currently housing the flags and an FK to a lookup table. The lookup table would be FlagID, FlagName ("Flag" should be replaced with whatever this data actually is "error" maybe). This has the added bonus of greatly simplifying queries and constraints on this data.