I have a parcels layer in an enterprise SQL Server Geodatabase (.mdf), when I perform a query on the layer to get the parcels with area larger than 100,000 m2 using find by attributes-dialog box (using “Shape.STArea()>=100000”), it returns the required set of parcels. But, when publishing a map service that contains this layer, and trying to run the same query at the level of ArcGIS Server it does not return any value, whereas it returns values for queries on other fields like ObjectID. What might be the issue here? This is shown with screenshots below.
Thank you.
Hani
________________________________________________________________
1- Query using find by attributes
2- The Query runs fine returns the right parcels
3- Query at the level of ArcGIS
4- The query fails
5- A query with ObjectID field at level of ArcGIS; it runs well!!
Solved! Go to Solution.
Hani,
Unfortunately this is known limit when you have StandardardizedQueries enabled.
If you data are not sensitive, then you may consider disabling StandardizedQueries or copy values from Shape.STArea() field to a separate field and query on that new field -- these are workarounds I can think of.
Hani,
Unfortunately this is known limit when you have StandardardizedQueries enabled.
If you data are not sensitive, then you may consider disabling StandardizedQueries or copy values from Shape.STArea() field to a separate field and query on that new field -- these are workarounds I can think of.
Many thanks Tanu!
I disabled standardized Queries, and then the query went well, but still I don't understand how this affects me? can you elaborate? I referred to your link but I didn't catch the point.
You could also create a spatial view and include the area column with an alias and publish the spatial view so StandardizedQueries can remained enabled. StandardizedQueries provides the ability to be cross-db compliant and saftey from SQL injection attacks.
Thank you Ronnie for your valuable input, could you please elaborate more with screenshots?