M
Moreira
Hello,
We made a script to update some inconsistent dates in some projects. But
this updates are not reflecting in PWA! We called Microsoft and they said
that they only garantee the publishing in PWA if we update manually in the
Project! That makes the EPM the first system I know that do not allow an
update by a batch program!
Below the script we used. Any help will be helpful!
Thanks in advance
Moreira
BEGIN TRANSACTION
--- COMMIT TRANSACTION
--- ROLLBACK TRANSACTION
UPDATE MSP_TASKS
SET TASK_BASE_START = PROJ_DATA_INICIAL, TASK_BASE_FINISH = PROJ_DATA_FINAL
FROM (
SELECT DISTINCT
WPROJ_ID, D.PROJ_ID,
REPLACE(REPLACE(REPLACE(D.PROJ_PROJECT, '<',''),'>',''),'\','')
PROJ_NAME,
CONVERT(DATETIME,D.PROJ_INFO_START_DATE,113) PROJ_DATA_INICIAL,
CONVERT(DATETIME,D.PROJ_INFO_FINISH_DATE,113) PROJ_DATA_FINAL,
ISNULL(SQL_SITUACAO.TEXT_VALUE,'SEM') SITUACAO,
E.TASK_PCT_COMP,
H.ATRIBUTO,
E.TASK_EARLY_START, E.TASK_EARLY_FINISH, E.TASK_BASE_START,
E.TASK_BASE_FINISH, E.TASK_ACT_FINISH
FROM
MSP_CONVERSIONS A,
MSP_CODE_FIELDS B,
MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_5 C,
MSP_TASKS E,
PROJ_ATRIBUTO H,
MSP_WEB_PROJECTS W,
MSP_PROJECTS D LEFT JOIN
(SELECT TEXT_VALUE,PROJ_ID FROM MSP_TEXT_FIELDS WHERE
TEXT_FIELD_ID=188744768 AND TEXT_REF_UID = 0) SQL_SITUACAO
ON SQL_SITUACAO.PROJ_ID = D.PROJ_ID
WHERE
A.CONV_VALUE = 188744593
AND E.TASK_UID = 0
AND E.TASK_OUTLINE_NUM = 0
AND B.PROJ_ID = D.PROJ_ID
AND A.CONV_VALUE = B.CODE_FIELD_ID
AND C.PROJ_OUTLINECODE_ID = B.CODE_UID
AND E.PROJ_ID = D.PROJ_ID
AND H.PROJ_ID = D.PROJ_ID
AND W.PROJ_ID = D.PROJ_ID
AND H.ATRIBUTO = 'Manutenção'
) AS TESTE
WHERE
MSP_TASKS.TASK_PCT_COMP = '100'
AND MSP_TASKS.PROJ_ID IN ('5925')
AND (MSP_TASKS.TASK_BASE_START IS NULL OR MSP_TASKS.TASK_BASE_FINISH IS NULL)
AND MSP_TASKS.TASK_UID = 0
AND MSP_TASKS.TASK_OUTLINE_NUM = 0
We made a script to update some inconsistent dates in some projects. But
this updates are not reflecting in PWA! We called Microsoft and they said
that they only garantee the publishing in PWA if we update manually in the
Project! That makes the EPM the first system I know that do not allow an
update by a batch program!
Below the script we used. Any help will be helpful!
Thanks in advance
Moreira
BEGIN TRANSACTION
--- COMMIT TRANSACTION
--- ROLLBACK TRANSACTION
UPDATE MSP_TASKS
SET TASK_BASE_START = PROJ_DATA_INICIAL, TASK_BASE_FINISH = PROJ_DATA_FINAL
FROM (
SELECT DISTINCT
WPROJ_ID, D.PROJ_ID,
REPLACE(REPLACE(REPLACE(D.PROJ_PROJECT, '<',''),'>',''),'\','')
PROJ_NAME,
CONVERT(DATETIME,D.PROJ_INFO_START_DATE,113) PROJ_DATA_INICIAL,
CONVERT(DATETIME,D.PROJ_INFO_FINISH_DATE,113) PROJ_DATA_FINAL,
ISNULL(SQL_SITUACAO.TEXT_VALUE,'SEM') SITUACAO,
E.TASK_PCT_COMP,
H.ATRIBUTO,
E.TASK_EARLY_START, E.TASK_EARLY_FINISH, E.TASK_BASE_START,
E.TASK_BASE_FINISH, E.TASK_ACT_FINISH
FROM
MSP_CONVERSIONS A,
MSP_CODE_FIELDS B,
MSP_CUBE_ENTERPRISE_PROJECT_OUTLINE_5 C,
MSP_TASKS E,
PROJ_ATRIBUTO H,
MSP_WEB_PROJECTS W,
MSP_PROJECTS D LEFT JOIN
(SELECT TEXT_VALUE,PROJ_ID FROM MSP_TEXT_FIELDS WHERE
TEXT_FIELD_ID=188744768 AND TEXT_REF_UID = 0) SQL_SITUACAO
ON SQL_SITUACAO.PROJ_ID = D.PROJ_ID
WHERE
A.CONV_VALUE = 188744593
AND E.TASK_UID = 0
AND E.TASK_OUTLINE_NUM = 0
AND B.PROJ_ID = D.PROJ_ID
AND A.CONV_VALUE = B.CODE_FIELD_ID
AND C.PROJ_OUTLINECODE_ID = B.CODE_UID
AND E.PROJ_ID = D.PROJ_ID
AND H.PROJ_ID = D.PROJ_ID
AND W.PROJ_ID = D.PROJ_ID
AND H.ATRIBUTO = 'Manutenção'
) AS TESTE
WHERE
MSP_TASKS.TASK_PCT_COMP = '100'
AND MSP_TASKS.PROJ_ID IN ('5925')
AND (MSP_TASKS.TASK_BASE_START IS NULL OR MSP_TASKS.TASK_BASE_FINISH IS NULL)
AND MSP_TASKS.TASK_UID = 0
AND MSP_TASKS.TASK_OUTLINE_NUM = 0