I'm using SQLExecutor to fire queries like this at an SQL Server Spatial point layer (Geometry data type), except the polygon geometries are much more complex:
SELECT Count(MyField) AS CountMyField FROM [db].[owner].[table] WHERE WKB_Geometry.STWithin(geometry::STGeomFromText('MULTIPOLYGON (((527049.5 137150.4,527056.6 137139.7,527063.3 137134.4,527049.5 137150.4)))', 27700)) = 1
However, after about 2400 features have entered the Initiator port, I get this error and the translation fails:
"The app domain with specified version id (%d) was unloaded due to memory pressure and could not be found."
Ultimately I will be processing hundreds of thousands of features so I need a solution that will work with that volume of data, not just a few thousand input features.
I know I can read the point layer in to my Workspace, but SQLExecutor is SO much faster.
Any suggestions?