Hi Rouf,
I have the same problem. It may be the bugs of arcgisServer.
Here I describe it in detail.
Environment:
ArcGIS Server :10.2.2
ArcGIS desktop for publish Service:10.1
ArcSDE: 10.1
Issue:
line feature in SDE published on Server. I want to get sum line length by some attribute.
On rest service page , set parameters for statistics. Click "query" button it returns "SUM(SHAPE.LEN) AS AAAA: xxxx".
AAAA-outStatisticFieldName. The response of the request should be :AAAA: xxxx.
There is no Server API can get the value of SUM(SHAPE.LEN) AS AAAA:
The screenshot of the rest service response is as the pic:
According to local ESRI support the reason is :
SDE is based on old version of Sqlserver(mine is 2005). Geometry data is stored as SDEBINARY type in SDE.
Geometry objects stored in shape and f table. The line length is calculated based on union query. So the query result is "sum(shape.len) as xxxx".
The way to solve this is to use SQLServer 2008 or above.