How does one include a foreign value in a computed column within SQL Server? The goal is to display a particular field, from the parent table, in the child table.
Here are a few example tables to help explain:
ClientID int PK
LocationID int PK
ClientID int FK
If I have two clients:
And, if each client has two locations:
The goal is for the "DisplayName" column on ClientLocation to show the following:
Cool Company (Main Office)
Cool Company (Warehouse)
Outstanding Client (Main Office)
Outstanding Client (Warehouse)
From what I can tell, it is not possible to do a join within the formula of a computed column. I can come close by creating custom functions for every possible column on every possible table that I want to get back, however that is not very practical.
Thanks, in advance, for taking the time to respond.