Reputation: 1
Here is the starting point:
"dbo.Person" Table
Id | FirstNameStringId | LastNameStringId
..... ................. ................
236 | 1234 | 5678
"StringCulture.dbo"
So this table defines the value of each StringId
StringId | CultureCode | Value
........ ............ .....
1234 | en-GB | Bob
5678 | en-GB | Smith
This is what I need ...
Generate a table (exported to Excel) that shows
Id | LastName | FirstName
... ........ ..........
236 | Bob | Smith
Would appreciate some feedback as to the Procedure or Query I need to use to generate the table, and then export it.
Upvotes: 0
Views: 17
Reputation: 20320
Just join to the Stringculture table twice using aliases.
Select p.id,fn.value,ln.value
From person p
inner join StringCulture fn on fn.stringid = p.FirstNameStringId
inner join StringCulture ln on ln.stringid = p.LastNameStringId
is the basic idea.
You'd have use outer joins if it was possible for a person not to have first or /and last name
Upvotes: 1