none
При работе модуля задачи пересоздание хранимых процедур RRS feed

  • Вопрос

  • Здравствуйте. При отчетности специалистов когда осматриваешь процесс через SQL Profiler, видно пересоздание хранимых процедур. Которые уже есть в системе, пример

    CREATE PROCEDURE draft.MSP_ProjQ_Update_Skipped_Groups_Sub

      @GroupUID UID ,

      @State int

    AS

    BEGIN

    DECLARE @lastError INT

    SELECT @lastError = 0

    DECLARE @errInfo TABLE

    (

       CORRELATION_UID UNIQUEIDENTIFIER,

       GRP_QUEUE_ERROR_INFO NTEXT,

       PERCENT_COMPLETE INT,

       LAST_ADMIN_ACTION INT,

       GRP_QUEUE_MESSAGE_TYPE INT,

       GRP_QUEUE_STATE INT

    )

    INSERT INTO @errInfo(CORRELATION_UID, GRP_QUEUE_ERROR_INFO, PERCENT_COMPLETE, LAST_ADMIN_ACTION, GRP_QUEUE_MESSAGE_TYPE, GRP_QUEUE_STATE)

    SELECT CORRELATION_UID, GRP_QUEUE_ERROR_INFO, PERCENT_COMPLETE, LAST_ADMIN_ACTION, GRP_QUEUE_MESSAGE_TYPE, GRP_QUEUE_STATE

       FROM draft.MSP_QUEUE_PROJECT_GROUP

       WHERE GRP_UID = @GroupUID

       UPDATE draft.MSP_QUEUE_PROJECT_GROUP_ARCHIVE

          SET GRP_QUEUE_STATE = @State,

          GRP_QUEUE_ERROR_INFO = err.GRP_QUEUE_ERROR_INFO,

          PERCENT_COMPLETE = err.PERCENT_COMPLETE,

          LAST_ADMIN_ACTION = err.LAST_ADMIN_ACTION

          FROM draft.MSP_QUEUE_PROJECT_GROUP_ARCHIVE grp

          INNER JOIN @errInfo err

          ON grp.CORRELATION_UID = err.CORRELATION_UID

          AND grp.GRP_QUEUE_MESSAGE_TYPE = err.GRP_QUEUE_MESSAGE_TYPE

          WHERE grp.GRP_QUEUE_STATE IN (7,8)

    SELECT @lastError = @@ERROR

    RETURN @lastError

    END

     
    22 марта 2016 г. 4:11

Все ответы