I have developed an Excel 2013 VBA macro which collects almost 2,000 unique, 10-character, record identifiers from a series of archive .xls files and holds them in a Dictionary object from which an array can be produced.
In order to prove the validity of these record identifiers I need to compare them to the contents of a SQLServer2008 database table.
I am able to test each record identifier individually (using ADODB) but I have concerns about sequentially, and rapidly, firing off nearly 2,000 SQL enquiries.
I know that I could possibly use the SQL "IN" clause with a concatenated string of record identifiers but this could mean the use of a 20,000+ character SQL command string (is that possible?) or breaking it up into "batches". Also, I have read that the use of the "IN" clause is frowned upon because of the load imposed on SQLServer in dissembling the concatenated string structure prior to actually enacting the enquiry.
So, my question is this: might it be possible to efficiently "import" the collection of record identifiers (from an array?) to a temporary database table which can then be cited in a standard SQL enquiry using a "JOIN" clause to identify the valid record identifiers?
As ever, all and any offers of advice or help will be much appreciated.
Paul J