Select serviceid from dorgtoservice where orgID = #URL.Orgid# Delete from dOrgtoService where OrgID =#URL.orgid# and ServiceID = #OtherServiceArray[x]# delete from dOrgToService Where OrgID = #URL.ORGID# Select max(ServicetoOrgID) as maxOrgtoServiceID from dOrgtoService Insert Into dOrgtoService (ServicetoOrgID, OrgID, ServiceID) Values(#newServicetoOrgID#, #URL.OrgID#, #Array[x]#) Select max(ServicetoOrgID) as maxOrgtoServiceID from dorgtoservice Select max(ServiceID) as maxServiceID from dService Insert into dService(Serviceid, Service,Type, Approved,CenterID) Values(#newServiceID#, '#form.Other1#','Expertise',1,6) Select Max(serviceid) as maxSid from dService Insert into dOrgtoService (ServicetoOrgID, OrgID, ServiceID) Values(#newServicetoOrgID#, #URL.OrgID#, #getMaxServiceid.maxSid#) Select max(ServiceID) as maxServiceID from dService Select max(ServicetoOrgID) as maxOrgtoServiceID from dorgtoservice Insert into dService(ServiceID, Service,Type, Approved,CenterID) Values(#newServiceID#, '#form.Other2#','Resources',1,6) Select Max(serviceid) as maxSid from dService Insert into dOrgtoService (ServicetoOrgID, OrgID, ServiceID) Values(#newServicetoOrgID#, #URL.OrgID#, #getMaxServiceid.maxSid#) Select max(ServiceID) as maxServiceID from dService Select max(ServicetoOrgID) as maxOrgtoServiceID from dorgtoservice Insert into dService(ServiceID, Service,Type, Approved,CenterID) Values(#newServiceID#, '#form.Other3#','Clients',1,6) Select Max(serviceid) as maxSid from dService Insert into dOrgtoService (ServicetoOrgID, OrgID, ServiceID) Values(#newServicetoOrgID#, #URL.OrgID#, #getMaxServiceid.maxSid#)