:SetVar Function "AUX:MonthList"
:r $(DropFunctionScript_AUX)
create function [$(Function)]()
returns @ResultTable table
(
   [NO]              int                  not null,
   [Name]            $(dt_MonthName_AUX)  not null,
   [InGenitiveCase]  $(dt_MonthName_AUX)
)
AS
BEGIN
/*==================================================================================================
# SQLAUX scripting library | Author: Sergei Y.Kitáev
----------------------------------------------------------------------------------------------------
#
# MONTH LIST WITH NUMBERS AND LOCALIZED NAMES (TABLE FUNCTION):
#
# === Usage: ===
# select * from [AUX:MonthList]()
#
==================================================================================================*/
declare @LanguageId int
set @LanguageId = dbo.[AUX:ActiveLanguage]()
if @LanguageId=$(num_LanguageId_English_AUX) goto IN_ENGLISH
if @LanguageId=$(num_LanguageId_Russian_AUX) goto IN_RUSSIAN
--if @LanguageId=-1 goto IN_XLANG_1
--if @LanguageId=-2 goto IN_XLANG_2
goto $(DefaultLanguageLabel)
----------------------------------------------------------------------------------------------------
IN_ENGLISH:
insert @ResultTable
   select [NO], [Name], null 'InGenitiveCase'
   from [AUX::Month_list:En] (nolock)
   order by [NO]
return
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
IN_RUSSIAN:
insert @ResultTable
   select [NO], [Name], [InGenitiveCase]
   from [AUX::Month_list:Ru] (nolock)
   order by [NO]
return
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/*
IN_XLANG_1:
insert @ResultTable
   select [NO], [Name], null 'InGenitiveCase'
   from [AUX::Month_list:] (nolock)
   order by [NO]
return
*/
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/*
IN_XLANG_2:
insert @ResultTable
   select [NO], [Name], null 'InGenitiveCase'
   from [AUX::Month_list:] (nolock)
   order by [NO]
return
*/
/*================================================================================================*/
END
GO
/*
select * from [AUX:MonthList]()
*/
