:r "%simple_script%"
/*==================================================================================================
#
# SIMPLE SCRIPT (HELLO):
#
==================================================================================================*/
$(BEGIN_AUX)
----------------------------------------------------------------------------------------------------
--set NOCOUNT off

select N'Hello from simple SQL-script!' as 'GREETING:'
union select '' -- empty row (for text separation)

select $(msg_Greeting_X) as $(str_GreetingCaption_X)
union select '' -- empty row (for text separation)

-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
--raiserror ('Intentional exception (error test).',11,1)

select $(str_UnicodeString) as N'$(_DOLLAR_AUX)(str_UnicodeString)-property value (from SQL-project settings):'
union select '' -- empty row (for text separation)

----------------------------------------------------------------------------------------------------
-- SQLAUX-LIBRARY SYSTEM PROPERTIES (LISTING):

-- Temporary table deletion attempt (to run the script repeatedly in SSMS):
begin try drop table #Properties end try begin catch end catch
create table #Properties
(
   [Name]   $(dt_Name_AUX)    not null,-- nvarchar(100)
   [Value]  $(dt_String_AUX)  not null -- nvarchar(max)
)
insert #Properties values
   ( 'is_sqlaux_imported'           , '$(is_sqlaux_imported)' ),
   ( 'sql_translation_timestamp_aux', '$(sql_translation_timestamp_aux)' ),
   ( 'sql_settings_script_aux'      , '$(sql_settings_script_aux)' ),
   ( '', '' ) -- empty row (for text separation)

declare @NameCapacity int, @ValueCapacity int
select @NameCapacity=MAX(LEN([Name])), @ValueCapacity=MAX(LEN([Value])) from #Properties
:SetVar AlterColumn "alter table #Properties alter column"
EXEC('
   $(AlterColumn) [Name] nvarchar('+@NameCapacity+')
   $(AlterColumn) [Value] nvarchar('+@ValueCapacity+')
')
select [Name] 'SQLAUX system variable', [Value] 'Value' from #Properties

select '$(sql_translation_dir_aux)' as 'sql_translation_dir_aux (folder path ended with backslash):'
/*
# Uncomment the line below ("qwertyuiop") and run the query, then check line number of SQL-error (from the server).
# It has to be equal to the real value if you are using $SQLTRANS+SqlCatPP+SQLCMD,
# but it is not correct in case of SSMS in SQLCMD-mode (because it excludes source lines with :SetVar-directive).
*/
--qwertyuiop -- Incorrect syntax near 'qwertyuiop'.
----------------------------------------------------------------------------------------------------
$(END_AUX)
/*================================================================================================*/
GO
print ''
print '— — —'
GO
