Had the same error with a definition query on SHAPE.area > 15. Removed the query and the service published fine.
When trying to publish a map service am I get the followin error, ERROR 001272: Analyzer errors were encountered (codes = 7). I have been able to track the issue to the definition query. If a layer's defintion query has SHAPE.STLength() or SHAPE.STArea() in the query it will throw the error, but those are valid queries created using the Query Builder. I have been unable to find details about ERROR 001272. Any suggestions for a soltion?
Yes, but I need to have the definition query. I'll think I'll put a ticket in with Esri Support.
ESRI is aware of the problem. Bug NIM082764: Analyzer error 00007: Layer's definition query is invalid is appearing when publishing unexpectedly when publishing enterprise data with a definition expression based on the geometry fields.