Can anybody help me work out how to approach a common problem that I come across every now and then but tend to work around the long way? I'm trying to find an elegant way to identifying what Id's don't exist in a table given a large list of values.
I've been provided with an Excel sheet with a list of 4000+ string id's and I need to identify which of them don't exist in SQL Server table.
My first action was to use Notepad++ and convert the list into a CSV list similar to 'XX1','XX2','XX3' etc and the running a SELECT * FROM [TABLE] WHERE [ID] IN ('XX1','XX2','XX3',...). This shows up 2 fewer records than shown in Excel so now I need to sift through them to identify which two aren't in the database.
Thanks for any help.
Paul.