I am trying to automate updates to the All Subscribers list whenever the preferred e-mail in Salesforce changes. I created a SQL query activity that compares our Salesforce data extension to the e-mail in the All Subscribers list and populates a data extension with the results. However, I am getting a ton of false positive matches. This is the query:
SELECT
sfdc.Id as "Subscriber Key",
sfdc.Email as "Email Address"
FROM Contact_Salesforce as sfdc
INNER JOIN _subscribers as allsub ON sfdc.Id = allsub.SubscriberKey
WHERE sfdc.Email != allsub.EmailAddress
AND CAST(sfdc.TE_Email_Info_Updated__c as DATE) >= '2018-12-01'
AND sfdc.TE_Email_Info_Updated__c != NULL
In many cases I'll get a result where the e-mail address is the exact same in both the All Subscribers list and the synchronized data extension. It's entirely possible that I have an extra space or something in either place, but from the manual reviews I've done, that doesn't appear to be the case.
On a related note, since you can't just run a query against your dataset in MC, is there a resource or best practice for debugging issues with SQL queries? Normally, I think I'd like to run counts to debug my queries (such as counting the lengths of both e-mails to ensure there's not an extra space for false-positive matches), but updating a DE every time I want to run a query seems like overkill.
At any rate, thank you for your help. Let me know if you have any questions about anything or need more info.