Запросить состояние «COMPATIBILITY_MODE» вкл / выкл из другого сеанса в ASE

Вы можете найти, что помещать внутри функции JavaScript в этом сообщении.

function getAjax() {
    try {
        if (window.XMLHttpRequest) {
            return new XMLHttpRequest();
        } else if (window.ActiveXObject) {
            try {
                return new ActiveXObject('Msxml2.XMLHTTP');
            } catch (try_again) {
                return new ActiveXObject('Microsoft.XMLHTTP');
            }
        }
    } catch (fail) {
        return null;
    }
}

function sendMail(to, subject) {
     var rq = getAjax();

     if (rq) {
         // Success; attempt to use an Ajax request to a PHP script to send the e-mail
         try {
             rq.open('GET', 'sendmail.php?to=' + encodeURIComponent(to) + '&subject=' + encodeURIComponent(subject) + '&d=' + new Date().getTime().toString(), true);

             rq.onreadystatechange = function () {
                 if (this.readyState === 4) {
                     if (this.status >= 400) {
                         // The request failed; fall back to e-mail client
                         window.open('mailto:' + to + '?subject=' + encodeURIComponent(subject));
                     }
                 }
             };

             rq.send(null);
         } catch (fail) {
             // Failed to open the request; fall back to e-mail client
             window.open('mailto:' + to + '?subject=' + encodeURIComponent(subject));
         }
     } else {
         // Failed to create the request; fall back to e-mail client
         window.open('mailto:' + to + '?subject=' + encodeURIComponent(subject));
     }
}

Предоставьте собственный скрипт PHP (или любой другой язык) для отправки электронной почты.

1
задан guru 13 July 2018 в 12:43
поделиться

1 ответ

Да, вы можете, для данного SPID, проверить SUID процесса и запустить:

dbcc traceon(3604)
go
dbcc pss(@suid, @spid)
go

На выходе у вас есть, например:

...
poptions=7 (OPT_TRUNCABORT) 8 (OPT_ARITHABORT) 40 (OPT_PREFETCH) 
41 (OPT_TRIGGERS) 42 (OPT_REPLICATION_1) 43 (OPT_REPLICATION_2) 
48 (OPT_TRANSRPC) 58 (OPT_REMOTE_INDEXES) 62 (OPT_STMT_CACHE) 
64 (OPT_PROC_RETURN_STATUS) 65 (OPT_PROC_OUTPUT_PARAMS) 
84 (OPT_LITERAL_AUTOPARAM) 93 (OPT_COMPATIBILITY_MODE) 
107 (OPT_FDP_CURRENCY) 
...

flag OPT_COMPATIBILITY_MODE указывает, что в этом сеансе включен режим совместимости.

1
ответ дан markp 17 August 2018 в 12:49
поделиться
Другие вопросы по тегам:

Похожие вопросы: