--:SetVar Function "AUX:MonthList"
if exists( select * from [sysobjects] (nolock) where [type] in ('FN','TF') and [name]=N'AUX:MonthList' )
   drop function [AUX:MonthList]
GO
/* Translated by $SQLTRANS utility (SQL-file technology). Method author: Sergei Y.Kitáev.
** Script translation date-time: 2022-11-27 00:29:27.24 (stamp of SQL-file generation). */
create function [AUX:MonthList]()
returns @ResultTable table
(
   [NO]              int                  not null,
   [Name]            nvarchar(15)  not null,
   [InGenitiveCase]  nvarchar(15)
)
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=0 goto IN_ENGLISH
if @LanguageId=21 goto IN_RUSSIAN
--if @LanguageId=-1 goto IN_XLANG_1
--if @LanguageId=-2 goto IN_XLANG_2
goto IN_ENGLISH
----------------------------------------------------------------------------------------------------
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]()
*/
