--:SetVar Function "AUX:DateTimeAsString.Ext"
if exists( select * from [sysobjects] (nolock) where [type] in ('FN','TF') and [name]=N'AUX:DateTimeAsString.Ext' )
   drop function [AUX:DateTimeAsString.Ext]
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:DateTimeAsString.Ext]( @DateTime datetime2,
                               @Options bit = 3 )
returns nvarchar(50)
BEGIN
/*==================================================================================================
# SQLAUX scripting library | Author: Sergei Y.Kitáev
----------------------------------------------------------------------------------------------------
#
# DATE-TIME AS STRING REPRESENTATION:
# - “MM/DD/YYYY HH:MM:SS” (EN);
# - “DD.MM.YYYY HH:MM:SS” (RU)
# (EXTENDED VERSION)
#
# === @Options: ===
# $(opt_MonthNameWithYear_PostscriptWithYearSign_AUX) = 1
# $(opt_MonthNameWithYear_PostscriptThroughSpace_AUX) = 2
# $(opt_DateTimeAsString_Default_AUX) = $(opt_MonthNameWithYear_Default_AUX) = 3
#
# === Usage: ===
# dbo.[AUX:DateTimeAsString.Ext]( <Date-time>, null, null )
# dbo.[AUX:DateTimeAsString.Ext]( <Date-time>, 1, 0 )
# dbo.[AUX:DateTimeAsString.Ext]( <Date-time>, 0, 0 )
#
==================================================================================================*/

return
   dbo.[AUX:DateAsString.Ext]( @DateTime, @Options )+' '+
   dbo.[AUX:ToString.Time]( @DateTime )

/*================================================================================================*/
END
GO
/*
select dbo.[AUX:DateTimeAsString.Ext]( GETDATE(), 0 ) 'Current date-time as string'
select dbo.[AUX:DateTimeAsString.Ext]( GETDATE(), 1 ) 'Current date-time as string'
select dbo.[AUX:DateTimeAsString.Ext]( GETDATE(), 3 ) 'Current date-time as string'
select dbo.[AUX:DateTimeAsString.Ext]( GETDATE(), null ) 'Current date-time as string'
*/
