I have a column in my table called MonitoredBy and it's a bitmask of 3 possible values.
This is how I am working with it in C#:
I am writing a query that my boss wants to run in sql server. So when I select tblSystemData.MonitoredBy it's returning 7 when all bits are on. She wants that resolved.
I don't know if she would like three columns back listing Motorola, State NCC and Customer with a Y or N in each column.
Of if she would prefer one column saying "Motorola, StateNCC, Customer". And sometimes it would say "Motorola", sometimes "Motorola, Customer" etc.
I think I can handle the former on my own. How would I do the latter? I could do it with a big case...else of 7, 6, 5, etc which is fine for this small example, but what if there were more values making that unwieldy?
Thanks.
This is how I am working with it in C#:
Code:
enum SystemDataMonitoredBy
{
None = 0,
Motorola = 1,
StateNCC = 2,
Customer = 4
}
I don't know if she would like three columns back listing Motorola, State NCC and Customer with a Y or N in each column.
Of if she would prefer one column saying "Motorola, StateNCC, Customer". And sometimes it would say "Motorola", sometimes "Motorola, Customer" etc.
I think I can handle the former on my own. How would I do the latter? I could do it with a big case...else of 7, 6, 5, etc which is fine for this small example, but what if there were more values making that unwieldy?
Thanks.