begin tran
IF NOT EXISTS (SELECT 1 FROM IM_LOC_GRP where LOC_GRP_ID = 'IPAAS')
BEGIN
INSERT INTO [dbo].[IM_LOC_GRP]([LOC_GRP_ID],[DESCR],[DESCR_UPR],[LST_MAINT_DT],[LST_MAINT_USR_ID])
VALUES ('IPAAS','ipaas location-specific-inventory','IPAAS LOCATION-SPECIFIC-INVENTORY',getdate(),'REDROOK')
END
delete from IM_LOC_GRP_LOC where LOC_GRP_ID = 'IPAAS'
insert into IM_LOC_GRP_LOC (LOC_GRP_ID, LOC_ID, SEQ_NO, LST_MAINT_DT, LST_MAINT_USR_ID)
select 'IPAAS' as LOC_GRP_ID, LOC_ID, ROW_NUMBER() OVER (ORDER BY LOC_ID) as SEQ_NO, getdate() as LST_MAINT_DT, 'REDROOK' as LST_MAINT_USR_ID from IM_LOC
select * from IM_LOC_GRP_LOC where LOC_GRP_ID = 'IPAAS'
rollback tran
--commit tran
Add Location Group "IPAAS" Print
Modified on: Fri, May 22, 2020 at 9:46 AM
Did you find it helpful? Yes No
Send feedbackSorry we couldn't be helpful. Help us improve this article with your feedback.