...
Code Block | ||||
---|---|---|---|---|
| ||||
select * from Inv_Global_Windows_Users GWU WHERE EXISTS (select 1 from ResourceKey RK where RK.KeyName = 'name.domain' and RK.KeyValue= (upper(GWU.UserId) + '.' + upper(GWU.Domain)) and RK.ResourceGuid != GWU._ResourceGuid) |
Code Block | ||||
---|---|---|---|---|
| ||||
select * from Inv_Global_Windows_Users GWU WHERE NOT EXISTS (select 1 from ResourceKey RK where RK.KeyName = 'name.domain' and RK.KeyValue= (upper(GWU.UserId) + '.' + upper(GWU.Domain))) AND UserId IS NOT NULL |
Code Block | ||||
---|---|---|---|---|
| ||||
INSERT INTO ResourceKey(ResourceGuid, KeyName, KeyValue) select GWU._ResourceGuid, 'name.domain', (GWU.UserId + '.' + GWU.Domain) from Inv_Global_Windows_Users GWU WHERE NOT EXISTS (select 1 from ResourceKey RK where RK.KeyName = 'name.domain' and RK.KeyValue= (upper(GWU.UserId) + '.' + upper(GWU.Domain))) AND UserId IS NOT NULL |