Run the attached query, ensuring you're running the query on the CRM database (if you run it on anything else, it'll likely fail)
-- Run these queries in two batches:
-- Batch 1
-- Removes relationships from Sage 100 Customers and Company records in Sage CRM
Update Company Set comp_mas_ardivisionno = NULL, comp_mas_customerno = NULL, comp_mas_customertype = NULL, comp_mas_defaultpaymenttype = NULL, comp_mas_pricelevel = NULL, comp_mas_salespersondivisionno = NULL, comp_mas_salespersonno = NULL, comp_mas_taxschedule = NULL, comp_mas_taxscheduledesc = NULL, comp_mas_termscode = NULL, comp_mas_termscodedesc = NULL, comp_MAS_CompanyCode = NULL, comp_MAS_CompanyKey = NULL, comp_mas_CustomerStatus = NULL, comp_mas_CustomerStatusLongDes = NULL, comp_mas_InactiveReasonCode = NULL, comp_mas_InactiveReasonCodeDes = NULL
-- Removes relationships from Sage 100 Contacts and Person records in Sage CRM
Update Person Set pers_mas_ardivisionno = NULL, pers_mas_customerno = NULL, pers_mas_contactcode = NULL, pers_MAS_CompanyCode = NULL, pers_MAS_CompanyKey = NULL
-- Removes relationships from Sage 100 Ship-to Addresses in Sage 100 and Addresses in Sage CRM
Update Address_Link Set AdLi_mas_ardivisionno = NULL, AdLi_mas_customerno = NULL, AdLi_mas_contactcode = NULL, AdLi_mas_shiptocode = NULL, AdLi_MAS_CompanyCode = NULL, AdLi_MAS_CompanyKey = NULL
-- Removes relationships b/t Sage 100 Contacts and their Phone Numbers in Sage CRM
Update PhoneLink Set PLink_ARDivisionNo = NULL, PLink_CustomerNo = NULL, PLink_ContactCode = NULL, PLink_MAS_CompanyCode = NULL, PLink_MAS_CompanyKey = NULL
-- Removes relationships b/t Sage 100 Contacts and their Email Addresses in Sage CRM
Update EmailLink Set ELink_ARDivisionNo = NULL, ELink_CustomerNo = NULL, ELink_ContactCode = NULL, ELink_MAS_CompanyCode = NULL, ELink_MAS_CompanyKey = NULL
-- Removes relationships from Orders in CRM and Sales Orders in Sage 100
Update Orders Set orde_MASDocumentNo = NULL, orde_MASDocumentType = NULL, orde_MASDocumentDate = NULL, orde_MASSequenceNo = NULL, orde_masconfirmto = NULL, orde_masfob = NULL, orde_MAS_CompanyKey = NULL, orde_MAS_CompanyCode = NULL, orde_mastermsdesc = NULL, orde_massalestaxamt = NULL, orde_masfreightamt = NULL, orde_masdepositamt = NULL, orde_masbalancedue = NULL, orde_masordercomment = NULL
-- Removes item relationships b/t Order Items in CRM and Line Items in Sage 100
Update OrderItems Set orit_masdocumentno = NULL, orit_masdocumenttype = NULL, orit_masdocumentdate = NULL, orit_massequenceno = NULL, orit_masitemcode = NULL, orit_MASItemDesc = NULL, orit_masunitofmeasure = NULL, orit_maswarehousecode = NULL, orit_maskityesno = NULL, orit_MASQuantity = NULL
-- Removes relationships from Quotes in CRM and Sales Orders in Sage 100
Update Quotes Set quot_MASDocumentNo = NULL, quot_MASDocumentType = NULL, quot_MASDocumentDate = NULL, quot_MASSequenceNo = NULL, quot_masconfirmto = NULL, quot_masfob = NULL, quot_MAS_CompanyKey = NULL, quot_MAS_CompanyCode = NULL, quot_mastermsdesc = NULL, quot_massalestaxamt = NULL, quot_masfreightamt = NULL, quot_masdepositamt = NULL, quot_masbalancedue = NULL, quot_masordercomment = NULL
-- Removes item relationships b/t Quote Items in CRM and Line Items in Sage 100
Update QuoteItems Set quit_masdocumentno = NULL, quit_masdocumenttype = NULL, quit_masdocumentdate = NULL, quit_massequenceno = NULL, quit_masitemcode = NULL, quit_MASItemDesc = NULL, quit_masunitofmeasure = NULL, quit_maswarehousecode = NULL, quit_maskityesno = NULL, quit_MASQuantity = NULL
-- Batch 2
Truncate Table CRMEmailPhoneData