I've attached a document that has some code that I've modified and would like to use in a worksheet, which both Inserts and then Selects Data to be imported into Excel. The queries and connection strings work fine. We are currently using them within SSMS and the data is published to a grid within SSMS.
Normally, we would just copy and paste the data, but lately there seems to be a memory problem within SSMS that prevents us from being able to do this all at once.
I would like for an EE who knows SQL Data to look over the code, and/or make recommendations on a best process/practice for doing this, if it seems there may be issues.