In my code i tend to use a lot of Flags enums that correspond to a DB table that contain all their behavioral properties.
This way the behavioral properties can be use both in SP and in C# code that uses the enum.
My problem is with Enums that have the Flags attribute attached to them.
Is there a way to automatically generate powers of 2 as identity column (or as a sequence) for such tables?
PS: currently i manually place the code in small table – or programmatically in tables that change over time – i prefer to do it automatically
As far as I know, the answer is NO. Identity is meant to increment by the value of seed you specified which is 1 by default. But you can have identity in multiple of 2. e.g. 2,4,6,8,10
If you want something else you might need to implement your own.
Computed Columns