Sql – Why is .NET Sql Server access faster than Excel Interop

comexcel-interopnetsql server

This might be a loaded question, and it might get voted down, but it completely frustrates me.

When you use SQL Server in your development the data access is fast and efficient, but when you use COM to talk to Excel it is piggy slow.

It doesn't matter what data access technology you use, ADO, ADO.NET, LINQ, Entity Framework, Astoria (ADO.NET Data Services), they are all quicker than automating Excel.

If all you want is the data in cell "A1" from a Workbook, you need an Excel.Application, Excel.Workbook, Excel.Worksheet, and Excel.Range objects, just to get one data point.

WTF, Why is talking to SQL Server more efficient than talking to Excel? Excel is local and Sql Server may not be.

TIA
Chris

Best Answer

Because spinning up a big monolithic executable that was designed as an interactive application is slower than talking over a fast network to an application that was designed for the purpose.