if exists(
 SELECT *
  FROM ActiveSystemServer.cfg.Settings
 WHERE SettingId LIKE 'Values.Modules.Replication.DbInitializationBackupPath%'
   --AND LEN(SettingValue) > 1;
)
    select 1 as ok
else
    select 0 as ok

return

begin tran
INSERT INTO  ActiveSystemServer.cfg.[Settings] ([ApplicationId],
                        [SettingId],
                        [SettingValue],
                        [SettingTypeName],
                        [SettingIsFavorite],
                        [SettingIsAdmin],
                        [SettingPredefinedValues],
                        [SettingDocumentation])
SELECT '57DDA4A4-5004-4458-A749-C01EA953FC4C' AS [ApplicationId],
                        'Values.Modules.Replication.DbInitializationBackupPath2' AS [SettingId],
                        '' AS [SettingValue],
                        'String' AS [SettingTypeName],
                        0 AS [SettingIsFavorite],
                        1 AS [SettingIsAdmin],
                        NULL AS [SettingPredefinedValues],
                        NULL AS [SettingDocumentation]
WHERE NOT EXISTS(
    SELECT 1
    FROM ActiveSystemServer.cfg.Settings s
    WHERE s.[SettingId] = 'Values.Modules.Replication.DbInitializationBackupPath2'
)
rollback tran
