Hi there. all. I've been assigned a change request asking me to add a bit field to a few views but only to the views. My question is if this field does not exist in a table how can I hard-code it into a view? I hope this makes sense. In summary: I have existing views. I need to add the same field to all four these views. It will be a bit field. It does not exist on any of the tables the views refer to.
Not sure I understand you correctly, but you could always do something like SELECT ....., CAST(1 AS bit) FROM... but this request seems to be strange. This is a constant and therefore could just as well be added on the client side. Otherwise, if the column does not exist in any table, you can not refer to it in any view or other object, for that matter.
Just guessing, but probably the value will be derived using a CASE statement, based on specific column values, or it will be a lookup to a bit column on a reference table which is an attribute for a foreign key.