This would include:
Since there are no user-defined global variables in SQL Server, you'll have to use one of two approaches:
Example context_info t-sql:
declare @languagein varchar(30), @contextin varbinary(128),
@languageout varchar(30), @contextout varbinary(128)
select @languagein = 'ro-RO'
select @contextin = cast(@languagein as varbinary(128))
set context_info @contextin
--do whatever you like here: queries, stored procs.
--context_info stays 'ro-RO' for the duration of the session/connection
select @contextout = context_info()
set @languageout = replace(cast(@contextout as varchar(30)),0x00, '')
print @languageout
Another technique I've used in localization is a three part coalesce to insure a result. Check for language-region first, then language, then a default. Based on your query:
SELECT COALESCE(langregion.LookupValue, lang.LookupValue, fallback.LookupValue) LookupVal
FROM LookupTable1 fallback
LEFT OUTER JOIN LookupTable1 lang
ON lang.ID = fallback.ID AND lang.Lang = @language
LEFT OUTER JOIN LookupTable1 langregion
ON langregion.ID = fallback.ID AND langregion.Lang = @languagewithregion
WHERE fallback.ID = @Lookup_ID
AND fallback.Lang = @defaultlanguage