/*==================================================================================================
#
# REMOVING OF ALL AUXILIARY TABLES OF SQLAUX-LIBRARY:
#
==================================================================================================*/
begin begin try set xact_abort off; set ansi_nulls,ansi_null_dflt_on,quoted_identifier,arithabort,nocount on; set implicit_transactions off; declare @initial_tran_count_aux int, @is_local_tran_open_aux bit; select @initial_tran_count_aux=@@trancount, @is_local_tran_open_aux=0; end try begin catch throw; end catch; begin try
----------------------------------------------------------------------------------------------------
--:SetVar DropTable "if OBJECT_ID(@TableName,'U') is not null exec( 'drop table ['+@TableName+']' )"
----------------------------------------------------------------------------------------------------
declare @TableName nvarchar(max)
----------------------------------------------------------------------------------------------------
begin if @is_local_tran_open_aux=1 raiserror ('Local transaction nesting is forbidden. (Macro: BEGIN_TRANSACTION_AUX)',11,1); begin transaction; set @is_local_tran_open_aux=1; end
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

set @TableName='AUX::Month_list:En';   if OBJECT_ID(@TableName,'U') is not null exec( 'drop table ['+@TableName+']' );
set @TableName='AUX::Month_list:Ru';   if OBJECT_ID(@TableName,'U') is not null exec( 'drop table ['+@TableName+']' );
set @TableName='AUX::WeekDay_list:En'; if OBJECT_ID(@TableName,'U') is not null exec( 'drop table ['+@TableName+']' );
set @TableName='AUX::WeekDay_list:Ru'; if OBJECT_ID(@TableName,'U') is not null exec( 'drop table ['+@TableName+']' );
set @TableName='AUX::Roman_numbers';   if OBJECT_ID(@TableName,'U') is not null exec( 'drop table ['+@TableName+']' );

-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
begin if @is_local_tran_open_aux=0 raiserror ('Open local transaction is absent. (Macro: COMMIT_TRANSACTION_AUX)',11,1); commit transaction; set @is_local_tran_open_aux=0; end
----------------------------------------------------------------------------------------------------
if @is_local_tran_open_aux=1 raiserror ('Not closed local transaction was detected, previously opened by BEGIN_TRANSACTION_AUX macro.',11,1); end try begin catch if @is_local_tran_open_aux=1 and (@@trancount>@initial_tran_count_aux or xact_state()=-1) rollback transaction; set @is_local_tran_open_aux=0; throw; end catch; end
/*================================================================================================*/
GO
