Thanks David for your response. You query is good but I think you miss understood what I want. I'll try to make this more clear to understand.
This is the definition of my table:
Data: DataID [int], DataName [varchar], OrderSeq [int]
Containts all the data for the application.
DataCompanies: DataID [int], CompanyID [int], OrderSeq [int]
Containts the custom data for a given company
DataLabels: DataID [int], LanguageID [int], Label [varchar]
Containts the label to display in for each language
DataLabelsCompanies: DataID [int], LanguageID [int], CompanyID [int], Label [varchar]
Containts the custom label for a given company
This is an exemple of what the table may containt:
Data
1,Mister,1
2,Misses,2
3,Doctor,4
4,Miss,3
DataCompanies
1,1,3
2,1,1
4,1,2
1,3,4
2,3,2
3,3,1
4,3,3
DataLabels
1,1,Mr
1,2,M
2,1,Mrs
2,2,Mdm
3,1,Dr
3,2,Doc
4,1,Ms
4,2,Mdl
DataLabels
4,1,3,Miss
If the @CompanyID is equal to 1 and LanguageID to 2, I should get
2,Misses,M
4,Miss,Mdl
1,Mister,M
If the @CompanyID is equal to 2 and LanguageID to 1, I should get
1,Mister,Mr
2,Misses,Mrs
4,Miss,Ms
3,Doctor,Dr
If the @CompanyID is equal to 3 and LanguageID to 1, I should get
3,Doctor,Dr
2,Misses,Mrs
4,Miss,Miss
1,Mister,Mr
Is there an other way to get this data from my stored proc.
Stéphane Lajoie
|