From 31f26e67858f6a084fc0662ccb757a6d20cb8c60 Mon Sep 17 00:00:00 2001 From: FuriousLlama Date: Fri, 17 Jan 2025 15:09:08 -0800 Subject: [PATCH] aligning latest --- .../Alter Down/002_PSP_PIMS_Alter_Down.sql | 488 ------------------ 1 file changed, 488 deletions(-) diff --git a/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/002_PSP_PIMS_Alter_Down.sql b/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/002_PSP_PIMS_Alter_Down.sql index e2070325f7..08acaac39d 100644 --- a/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/002_PSP_PIMS_Alter_Down.sql +++ b/source/database/mssql/scripts/dbscripts/PSP_PIMS_LATEST/Alter Down/002_PSP_PIMS_Alter_Down.sql @@ -74,495 +74,7 @@ WHERE LEN(LEASE_DESCRIPTION) > 2000 GO IF @@ERROR <> 0 SET NOEXEC ON GO -<<<<<<< HEAD ALTER TABLE [dbo].[PIMS_LEASE_HIST] ALTER COLUMN [LEASE_DESCRIPTION] nvarchar(2000) NULL -======= - --- Drop foreign key constraint dbo.PIM_INTHLD_PIM_CMPRQP_FK -PRINT N'Drop foreign key constraint dbo.PIM_INTHLD_PIM_CMPRQP_FK' -GO -ALTER TABLE [dbo].[PIMS_COMP_REQ_PAYEE] - DROP CONSTRAINT IF EXISTS [PIM_INTHLD_PIM_CMPRQP_FK] -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - --- Drop foreign key constraint dbo.PIM_ACQNTM_PIM_CMPRQP_FK -PRINT N'Drop foreign key constraint dbo.PIM_ACQNTM_PIM_CMPRQP_FK' -GO -ALTER TABLE [dbo].[PIMS_COMP_REQ_PAYEE] - DROP CONSTRAINT IF EXISTS [PIM_ACQNTM_PIM_CMPRQP_FK] -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - --- Drop foreign key constraint dbo.PIM_CMPREQ_PIM_CMPRQP_FK -PRINT N'Drop foreign key constraint dbo.PIM_CMPREQ_PIM_CMPRQP_FK' -GO -ALTER TABLE [dbo].[PIMS_COMP_REQ_PAYEE] - DROP CONSTRAINT IF EXISTS [PIM_CMPREQ_PIM_CMPRQP_FK] -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - --- Drop index dbo.CMPRQP_INTEREST_HOLDER_ID_IDX -PRINT N'Drop index dbo.CMPRQP_INTEREST_HOLDER_ID_IDX' -GO -DROP INDEX IF EXISTS [dbo].[PIMS_COMP_REQ_PAYEE].[CMPRQP_INTEREST_HOLDER_ID_IDX] -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - --- Drop index dbo.CMPRQP_COMPENSATION_REQUISITION_ID_IDX -PRINT N'Drop index dbo.CMPRQP_COMPENSATION_REQUISITION_ID_IDX' -GO -DROP INDEX IF EXISTS [dbo].[PIMS_COMP_REQ_PAYEE].[CMPRQP_COMPENSATION_REQUISITION_ID_IDX] -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - --- Drop index dbo.CMPRQP_ACQUISITION_FILE_TEAM_ID_IDX -PRINT N'Drop index dbo.CMPRQP_ACQUISITION_FILE_TEAM_ID_IDX' -GO -DROP INDEX IF EXISTS [dbo].[PIMS_COMP_REQ_PAYEE].[CMPRQP_ACQUISITION_FILE_TEAM_ID_IDX] -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - --- Drop trigger dbo.PIMS_CMPREQ_I_S_U_TR -PRINT N'Drop trigger dbo.PIMS_CMPREQ_I_S_U_TR' -GO -DROP TRIGGER IF EXISTS [dbo].[PIMS_CMPREQ_I_S_U_TR] -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - --- Drop trigger dbo.PIMS_CMPREQ_A_S_IUD_TR -PRINT N'Drop trigger dbo.PIMS_CMPREQ_A_S_IUD_TR' -GO -DROP TRIGGER IF EXISTS [dbo].[PIMS_CMPREQ_A_S_IUD_TR] -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - --- Drop trigger dbo.PIMS_CMPREQ_I_S_I_TR -PRINT N'Drop trigger dbo.PIMS_CMPREQ_I_S_I_TR' -GO -DROP TRIGGER IF EXISTS [dbo].[PIMS_CMPREQ_I_S_I_TR] -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - --- Drop unique constraint dbo.PIMS_CMPRQP_H_UK -PRINT N'Drop unique constraint dbo.PIMS_CMPRQP_H_UK' -GO -ALTER TABLE [dbo].[PIMS_COMP_REQ_PAYEE_HIST] - DROP CONSTRAINT IF EXISTS [PIMS_CMPRQP_H_UK] -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - --- Drop primary key constraint dbo.PIMS_CMPRQP_H_PK -PRINT N'Drop primary key constraint dbo.PIMS_CMPRQP_H_PK' -GO -ALTER TABLE [dbo].[PIMS_COMP_REQ_PAYEE_HIST] - DROP CONSTRAINT IF EXISTS [PIMS_CMPRQP_H_PK] -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - --- Drop primary key constraint dbo.CMPRQP_PK -PRINT N'Drop primary key constraint dbo.CMPRQP_PK' -GO -ALTER TABLE [dbo].[PIMS_COMP_REQ_PAYEE] - DROP CONSTRAINT IF EXISTS [CMPRQP_PK] -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - --- Drop sequence dbo.PIMS_PROJECT_TEAM_ID_SEQ -PRINT N'Drop sequence dbo.PIMS_PROJECT_TEAM_ID_SEQ' -GO -DROP SEQUENCE IF EXISTS [dbo].[PIMS_PROJECT_TEAM_ID_SEQ] -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - --- Alter table dbo.PIMS_COMPENSATION_REQUISITION -PRINT N'Alter table dbo.PIMS_COMPENSATION_REQUISITION' -GO -ALTER TABLE [dbo].[PIMS_COMPENSATION_REQUISITION] - ADD [ACQUISITION_OWNER_ID] bigint NULL, - [INTEREST_HOLDER_ID] bigint NULL, - [ACQUISITION_FILE_TEAM_ID] bigint NULL - --- Drop dynamically-named default constraint -PRINT N'Drop dynamically-named default constraint' -GO -DECLARE @sqlQry VARCHAR(1000) -DECLARE @defName VARCHAR(100) -SET @defName = (SELECT obj.NAME - FROM SYSOBJECTS obj INNER JOIN - SYSCOLUMNS col on obj.ID = col.CDEFAULT INNER JOIN - SYSOBJECTS tbl on col.ID = tbl.ID - WHERE obj.XTYPE = 'D' - AND tbl.NAME = 'PIMS_DOCUMENT_QUEUE' - AND col.NAME = 'FILE_NAME') -SET @sqlQry = 'ALTER TABLE [dbo].[PIMS_DOCUMENT_QUEUE] DROP CONSTRAINT IF EXISTS [' + @defName + ']' -EXEC (@sqlQry) -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - -GO -EXEC sp_addextendedproperty - @name = N'MS_Description', @value = N'Foreign key to the PIMS_ACQUISITION_OWNER table.' , - @level0type = N'Schema', @level0name = N'dbo', - @level1type = N'Table', @level1name = N'PIMS_COMPENSATION_REQUISITION', - @level2type = N'Column', @level2name = N'ACQUISITION_OWNER_ID' -GO -EXEC sp_addextendedproperty - @name = N'MS_Description', @value = N'Foreign key to the PIMS_INTEREST_HOLDER table.' , - @level0type = N'Schema', @level0name = N'dbo', - @level1type = N'Table', @level1name = N'PIMS_COMPENSATION_REQUISITION', - @level2type = N'Column', @level2name = N'INTEREST_HOLDER_ID' -GO -EXEC sp_addextendedproperty - @name = N'MS_Description', @value = N'Foreign key to the PIMS_ACQUISITION_FILE_TEAM table.' , - @level0type = N'Schema', @level0name = N'dbo', - @level1type = N'Table', @level1name = N'PIMS_COMPENSATION_REQUISITION', - @level2type = N'Column', @level2name = N'ACQUISITION_FILE_TEAM_ID' -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - --- Create index dbo.CMPREQ_ACQUISITION_OWNER_ID_IDX -PRINT N'Create index dbo.CMPREQ_ACQUISITION_OWNER_ID_IDX' -GO -CREATE NONCLUSTERED INDEX [CMPREQ_ACQUISITION_OWNER_ID_IDX] - ON [dbo].[PIMS_COMPENSATION_REQUISITION]([ACQUISITION_OWNER_ID]) -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - --- Create index dbo.CMPREQ_ACQUISITION_FILE_PERSON_ID_IDX -PRINT N'Create index dbo.CMPREQ_ACQUISITION_FILE_PERSON_ID_IDX' -GO -CREATE NONCLUSTERED INDEX [CMPREQ_ACQUISITION_FILE_PERSON_ID_IDX] - ON [dbo].[PIMS_COMPENSATION_REQUISITION]([ACQUISITION_FILE_TEAM_ID]) --- Drop dynamically-named default constraint -PRINT N'Drop dynamically-named default constraint' -GO -DECLARE @sqlQry VARCHAR(1000) -DECLARE @defName VARCHAR(100) -SET @defName = (SELECT obj.NAME - FROM SYSOBJECTS obj INNER JOIN - SYSCOLUMNS col on obj.ID = col.CDEFAULT INNER JOIN - SYSOBJECTS tbl on col.ID = tbl.ID - WHERE obj.XTYPE = 'D' - AND tbl.NAME = 'PIMS_DOCUMENT_QUEUE_HIST' - AND col.NAME = 'FILE_NAME') -SET @sqlQry = 'ALTER TABLE [dbo].[PIMS_DOCUMENT_QUEUE_HIST] DROP CONSTRAINT IF EXISTS [' + @defName + ']' -EXEC (@sqlQry) -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - -UPDATE [dbo].[PIMS_PROJECT_PERSON] -SET PROJECT_PERSON_ROLE_TYPE_CODE = N'PROJMGR' - , CONCURRENCY_CONTROL_NUMBER = CONCURRENCY_CONTROL_NUMBER + 1 -WHERE PROJECT_PERSON_ROLE_TYPE_CODE IS NULL -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO -ALTER TABLE [dbo].[PIMS_PROJECT_PERSON] - ADD DEFAULT 'PROJMGR' FOR PROJECT_PERSON_ROLE_TYPE_CODE -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO --- Drop dynamically-named default constraint -PRINT N'Drop dynamically-named default constraint' -GO -DECLARE @sqlQry VARCHAR(1000) -DECLARE @defName VARCHAR(100) -SET @defName = (SELECT obj.NAME - FROM SYSOBJECTS obj INNER JOIN - SYSCOLUMNS col on obj.ID = col.CDEFAULT INNER JOIN - SYSOBJECTS tbl on col.ID = tbl.ID - WHERE obj.XTYPE = 'D' - AND tbl.NAME = 'PIMS_PROJECT_PERSON' - AND col.NAME = 'PROJECT_PERSON_ROLE_TYPE_CODE') -SET @sqlQry = 'ALTER TABLE [dbo].[PIMS_PROJECT_PERSON] DROP CONSTRAINT IF EXISTS [' + @defName + ']' -EXEC (@sqlQry) -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - -UPDATE [dbo].[PIMS_PROJECT_PERSON_HIST] -SET PROJECT_PERSON_ROLE_TYPE_CODE = N'PROJMGR' - , CONCURRENCY_CONTROL_NUMBER = CONCURRENCY_CONTROL_NUMBER + 1 -WHERE PROJECT_PERSON_ROLE_TYPE_CODE IS NULL -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - --- Drop dynamically-named default constraint -PRINT N'Drop dynamically-named default constraint' -GO -DECLARE @sqlQry VARCHAR(1000) -DECLARE @defName VARCHAR(100) -SET @defName = (SELECT obj.NAME - FROM SYSOBJECTS obj INNER JOIN - SYSCOLUMNS col on obj.ID = col.CDEFAULT INNER JOIN - SYSOBJECTS tbl on col.ID = tbl.ID - WHERE obj.XTYPE = 'D' - AND tbl.NAME = 'PIMS_PROJECT_PERSON_HIST' - AND col.NAME = 'PROJECT_PERSON_ROLE_TYPE_CODE') -SET @sqlQry = 'ALTER TABLE [dbo].[PIMS_PROJECT_PERSON_HIST] DROP CONSTRAINT IF EXISTS [' + @defName + ']' -EXEC (@sqlQry) -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - --- Create index dbo.CMPREQ_INTEREST_HOLDER_ID_IDX -PRINT N'Create index dbo.CMPREQ_INTEREST_HOLDER_ID_IDX' -GO -CREATE NONCLUSTERED INDEX [CMPREQ_INTEREST_HOLDER_ID_IDX] - ON [dbo].[PIMS_COMPENSATION_REQUISITION]([INTEREST_HOLDER_ID]) -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - --- Create trigger dbo.PIMS_CMPREQ_I_S_I_TR -PRINT N'Create trigger dbo.PIMS_CMPREQ_I_S_I_TR' -GO -CREATE TRIGGER [dbo].[PIMS_CMPREQ_I_S_I_TR] ON PIMS_COMPENSATION_REQUISITION INSTEAD OF INSERT AS -SET NOCOUNT ON -BEGIN TRY - IF NOT EXISTS(SELECT * FROM inserted) - RETURN; - - - insert into PIMS_COMPENSATION_REQUISITION ("COMPENSATION_REQUISITION_ID", - "ACQUISITION_FILE_ID", - "LEASE_ID", - "ACQUISITION_OWNER_ID", - "INTEREST_HOLDER_ID", - "ACQUISITION_FILE_TEAM_ID", - "CHART_OF_ACCOUNTS_ID", - "RESPONSIBILITY_ID", - "YEARLY_FINANCIAL_ID", - "ALTERNATE_PROJECT_ID", - "LEGACY_PAYEE", - "IS_DRAFT", - "IS_PAYMENT_IN_TRUST", - "GST_NUMBER", - "FISCAL_YEAR", - "AGREEMENT_DT", - "EXPROP_NOTICE_SERVED_DT", - "EXPROP_VESTING_DT", - "GENERATION_DT", - "FINALIZED_DATE", - "SPECIAL_INSTRUCTION", - "DETAILED_REMARKS", - "IS_DISABLED", - "CONCURRENCY_CONTROL_NUMBER", - "APP_CREATE_TIMESTAMP", - "APP_CREATE_USERID", - "APP_CREATE_USER_GUID", - "APP_CREATE_USER_DIRECTORY", - "APP_LAST_UPDATE_TIMESTAMP", - "APP_LAST_UPDATE_USERID", - "APP_LAST_UPDATE_USER_GUID", - "APP_LAST_UPDATE_USER_DIRECTORY") - select "COMPENSATION_REQUISITION_ID", - "ACQUISITION_FILE_ID", - "LEASE_ID", - "ACQUISITION_OWNER_ID", - "INTEREST_HOLDER_ID", - "ACQUISITION_FILE_TEAM_ID", - "CHART_OF_ACCOUNTS_ID", - "RESPONSIBILITY_ID", - "YEARLY_FINANCIAL_ID", - "ALTERNATE_PROJECT_ID", - "LEGACY_PAYEE", - "IS_DRAFT", - "IS_PAYMENT_IN_TRUST", - "GST_NUMBER", - "FISCAL_YEAR", - "AGREEMENT_DT", - "EXPROP_NOTICE_SERVED_DT", - "EXPROP_VESTING_DT", - "GENERATION_DT", - "FINALIZED_DATE", - "SPECIAL_INSTRUCTION", - "DETAILED_REMARKS", - "IS_DISABLED", - "CONCURRENCY_CONTROL_NUMBER", - "APP_CREATE_TIMESTAMP", - "APP_CREATE_USERID", - "APP_CREATE_USER_GUID", - "APP_CREATE_USER_DIRECTORY", - "APP_LAST_UPDATE_TIMESTAMP", - "APP_LAST_UPDATE_USERID", - "APP_LAST_UPDATE_USER_GUID", - "APP_LAST_UPDATE_USER_DIRECTORY" - from inserted; - -END TRY -BEGIN CATCH - IF @@trancount > 0 ROLLBACK TRANSACTION - EXEC pims_error_handling -END CATCH; - -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - --- Create trigger dbo.PIMS_CMPREQ_A_S_IUD_TR -PRINT N'Create trigger dbo.PIMS_CMPREQ_A_S_IUD_TR' -GO -CREATE TRIGGER [dbo].[PIMS_CMPREQ_A_S_IUD_TR] ON PIMS_COMPENSATION_REQUISITION FOR INSERT, UPDATE, DELETE AS -SET NOCOUNT ON -BEGIN TRY -DECLARE @curr_date datetime; -SET @curr_date = getutcdate(); - IF NOT EXISTS(SELECT * FROM inserted) AND NOT EXISTS(SELECT * FROM deleted) - RETURN; - - -- historical - IF EXISTS(SELECT * FROM deleted) - update PIMS_COMPENSATION_REQUISITION_HIST set END_DATE_HIST = @curr_date where COMPENSATION_REQUISITION_ID in (select COMPENSATION_REQUISITION_ID from deleted) and END_DATE_HIST is null; - - IF EXISTS(SELECT * FROM inserted) - insert into PIMS_COMPENSATION_REQUISITION_HIST ([COMPENSATION_REQUISITION_ID], [ACQUISITION_FILE_ID], [LEASE_ID], [ACQUISITION_OWNER_ID], [INTEREST_HOLDER_ID], [ACQUISITION_FILE_TEAM_ID], [CHART_OF_ACCOUNTS_ID], [RESPONSIBILITY_ID], [YEARLY_FINANCIAL_ID], [ALTERNATE_PROJECT_ID], [LEGACY_PAYEE], [IS_DRAFT], [IS_PAYMENT_IN_TRUST], [GST_NUMBER], [FISCAL_YEAR], [AGREEMENT_DT], [EXPROP_NOTICE_SERVED_DT], [EXPROP_VESTING_DT], [GENERATION_DT], [FINALIZED_DATE], [SPECIAL_INSTRUCTION], [DETAILED_REMARKS], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID], _COMPENSATION_REQUISITION_HIST_ID, END_DATE_HIST, EFFECTIVE_DATE_HIST) - select [COMPENSATION_REQUISITION_ID], [ACQUISITION_FILE_ID], [LEASE_ID], [ACQUISITION_OWNER_ID], [INTEREST_HOLDER_ID], [ACQUISITION_FILE_TEAM_ID], [CHART_OF_ACCOUNTS_ID], [RESPONSIBILITY_ID], [YEARLY_FINANCIAL_ID], [ALTERNATE_PROJECT_ID], [LEGACY_PAYEE], [IS_DRAFT], [IS_PAYMENT_IN_TRUST], [GST_NUMBER], [FISCAL_YEAR], [AGREEMENT_DT], [EXPROP_NOTICE_SERVED_DT], [EXPROP_VESTING_DT], [GENERATION_DT], [FINALIZED_DATE], [SPECIAL_INSTRUCTION], [DETAILED_REMARKS], [IS_DISABLED], [CONCURRENCY_CONTROL_NUMBER], [APP_CREATE_TIMESTAMP], [APP_CREATE_USERID], [APP_CREATE_USER_GUID], [APP_CREATE_USER_DIRECTORY], [APP_LAST_UPDATE_TIMESTAMP], [APP_LAST_UPDATE_USERID], [APP_LAST_UPDATE_USER_GUID], [APP_LAST_UPDATE_USER_DIRECTORY], [DB_CREATE_TIMESTAMP], [DB_CREATE_USERID], [DB_LAST_UPDATE_TIMESTAMP], [DB_LAST_UPDATE_USERID], (next value for [dbo].[PIMS_COMPENSATION_REQUISITION_H_ID_SEQ]) as [_COMPENSATION_REQUISITION_HIST_ID], null as [END_DATE_HIST], @curr_date as [EFFECTIVE_DATE_HIST] from inserted; - -END TRY -BEGIN CATCH - IF @@trancount > 0 ROLLBACK TRANSACTION - EXEC pims_error_handling -END CATCH; - -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - --- Create trigger dbo.PIMS_CMPREQ_I_S_U_TR -PRINT N'Create trigger dbo.PIMS_CMPREQ_I_S_U_TR' -GO -CREATE TRIGGER [dbo].[PIMS_CMPREQ_I_S_U_TR] ON PIMS_COMPENSATION_REQUISITION INSTEAD OF UPDATE AS -SET NOCOUNT ON -BEGIN TRY - IF NOT EXISTS(SELECT * FROM deleted) - RETURN; - - -- validate concurrency control - if exists (select 1 from inserted, deleted where inserted.CONCURRENCY_CONTROL_NUMBER != deleted.CONCURRENCY_CONTROL_NUMBER+1 AND inserted.COMPENSATION_REQUISITION_ID = deleted.COMPENSATION_REQUISITION_ID) - raiserror('CONCURRENCY FAILURE.',16,1) - - - -- update statement - update PIMS_COMPENSATION_REQUISITION - set "COMPENSATION_REQUISITION_ID" = inserted."COMPENSATION_REQUISITION_ID", - "ACQUISITION_FILE_ID" = inserted."ACQUISITION_FILE_ID", - "LEASE_ID" = inserted."LEASE_ID", - "ACQUISITION_OWNER_ID" = inserted."ACQUISITION_OWNER_ID", - "INTEREST_HOLDER_ID" = inserted."INTEREST_HOLDER_ID", - "ACQUISITION_FILE_TEAM_ID" = inserted."ACQUISITION_FILE_TEAM_ID", - "CHART_OF_ACCOUNTS_ID" = inserted."CHART_OF_ACCOUNTS_ID", - "RESPONSIBILITY_ID" = inserted."RESPONSIBILITY_ID", - "YEARLY_FINANCIAL_ID" = inserted."YEARLY_FINANCIAL_ID", - "ALTERNATE_PROJECT_ID" = inserted."ALTERNATE_PROJECT_ID", - "LEGACY_PAYEE" = inserted."LEGACY_PAYEE", - "IS_DRAFT" = inserted."IS_DRAFT", - "IS_PAYMENT_IN_TRUST" = inserted."IS_PAYMENT_IN_TRUST", - "GST_NUMBER" = inserted."GST_NUMBER", - "FISCAL_YEAR" = inserted."FISCAL_YEAR", - "AGREEMENT_DT" = inserted."AGREEMENT_DT", - "EXPROP_NOTICE_SERVED_DT" = inserted."EXPROP_NOTICE_SERVED_DT", - "EXPROP_VESTING_DT" = inserted."EXPROP_VESTING_DT", - "GENERATION_DT" = inserted."GENERATION_DT", - "FINALIZED_DATE" = inserted."FINALIZED_DATE", - "SPECIAL_INSTRUCTION" = inserted."SPECIAL_INSTRUCTION", - "DETAILED_REMARKS" = inserted."DETAILED_REMARKS", - "IS_DISABLED" = inserted."IS_DISABLED", - "CONCURRENCY_CONTROL_NUMBER" = inserted."CONCURRENCY_CONTROL_NUMBER", - "APP_LAST_UPDATE_TIMESTAMP" = inserted."APP_LAST_UPDATE_TIMESTAMP", - "APP_LAST_UPDATE_USERID" = inserted."APP_LAST_UPDATE_USERID", - "APP_LAST_UPDATE_USER_GUID" = inserted."APP_LAST_UPDATE_USER_GUID", - "APP_LAST_UPDATE_USER_DIRECTORY" = inserted."APP_LAST_UPDATE_USER_DIRECTORY" - , DB_LAST_UPDATE_TIMESTAMP = getutcdate() - , DB_LAST_UPDATE_USERID = user_name() - from PIMS_COMPENSATION_REQUISITION - inner join inserted - on (PIMS_COMPENSATION_REQUISITION.COMPENSATION_REQUISITION_ID = inserted.COMPENSATION_REQUISITION_ID); - -END TRY -BEGIN CATCH - IF @@trancount > 0 ROLLBACK TRANSACTION - EXEC pims_error_handling -END CATCH; - -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - --- Create foreign key constraint dbo.PIM_ACQOWN_PIM_CMPREQ_FK -PRINT N'Create foreign key constraint dbo.PIM_ACQOWN_PIM_CMPREQ_FK' -GO -ALTER TABLE [dbo].[PIMS_COMPENSATION_REQUISITION] - ADD CONSTRAINT [PIM_ACQOWN_PIM_CMPREQ_FK] - FOREIGN KEY([ACQUISITION_OWNER_ID]) - REFERENCES [dbo].[PIMS_ACQUISITION_OWNER]([ACQUISITION_OWNER_ID]) - ON DELETE NO ACTION - ON UPDATE NO ACTION -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - --- Create foreign key constraint dbo.PIM_INTHLD_PIM_CMPREQ_FK -PRINT N'Create foreign key constraint dbo.PIM_INTHLD_PIM_CMPREQ_FK' -GO -ALTER TABLE [dbo].[PIMS_COMPENSATION_REQUISITION] - ADD CONSTRAINT [PIM_INTHLD_PIM_CMPREQ_FK] - FOREIGN KEY([INTEREST_HOLDER_ID]) - REFERENCES [dbo].[PIMS_INTEREST_HOLDER]([INTEREST_HOLDER_ID]) - ON DELETE NO ACTION - ON UPDATE NO ACTION -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - --- Create foreign key constraint dbo.PIM_ACQPER_PIM_CMPREQ_FK -PRINT N'Create foreign key constraint dbo.PIM_ACQPER_PIM_CMPREQ_FK' -GO -ALTER TABLE [dbo].[PIMS_COMPENSATION_REQUISITION] - ADD CONSTRAINT [PIM_ACQPER_PIM_CMPREQ_FK] - FOREIGN KEY([ACQUISITION_FILE_TEAM_ID]) - REFERENCES [dbo].[PIMS_ACQUISITION_FILE_TEAM]([ACQUISITION_FILE_TEAM_ID]) - ON DELETE NO ACTION - ON UPDATE NO ACTION -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - --- Drop table dbo.PIMS_COMP_REQ_PAYEE_HIST -PRINT N'Drop table dbo.PIMS_COMP_REQ_PAYEE_HIST' -GO -DROP TABLE IF EXISTS [dbo].[PIMS_COMP_REQ_PAYEE_HIST] -GO -IF @@ERROR <> 0 SET NOEXEC ON -GO - --- Drop sequence dbo.PIMS_COMP_REQ_PAYEE_H_ID_SEQ -PRINT N'Drop sequence dbo.PIMS_COMP_REQ_PAYEE_H_ID_SEQ' -GO -DROP SEQUENCE IF EXISTS [dbo].[PIMS_COMP_REQ_PAYEE_H_ID_SEQ] ->>>>>>> dev GO IF @@ERROR <> 0 SET NOEXEC ON GO