Associations issue
select *
from datafiles_data
where Code in ('6674','6678', '7575')
and datafileid = 104
SELECT datafile_associations_data.AssociationID
,datafile_associations_data.DatafileDataID1 -- CustomerID
,datafile_associations_data.DatafileDataID2 -- DepotID
,datafile_associations_data.Properties
FROM datafile_associations_data
INNER JOIN datafile_associations
ON datafile_associations_data.AssociationID = datafile_associations.AssociationID
WHERE datafile_associations.AssociationName = 'CUSTOMER_DEPOTS'
AND datafile_associations_data.DatafileDataID1 in (30809,30897, 86143)
select *
from datafiles_data
where datafileid = 520
and datafiledataid in (24199,24201)
select *
from datafiles_data
where datafileid = 520
and datafiledataid in (24199,24201,32063,32064)
delete from datafile_associations_data
where DatafileDataID1 = 30809
and DatafileDataID2 = 24199
delete from datafile_associations_data
where DatafileDataID1 = 30897
and DatafileDataID2 = 24201