ERROR
When validating SQL with a computed column in a Query Layer in SQL Server, the following error may occur.
Underlying DBMS error: ~ No column name was specified for column [n] of 'a'.
A column alias is not specified for a computed column.
When a query layer is initially created, the user defined query is utilized as a sub-query to select the geometry column.
For example:
Code:
SELECT objectid, shape.STConvexHull() as shape2 FROM sde.mySpatialTable
Code:
exec sp_prepare @p1 ...,N'select shape2 from (SELECT objectid, shape.STConvexHull() as shape2
FROM sde.mySpatialTable) a',1
Code:
SELECT objectid, shape.STConvexHull() FROM sde.mySpatialTable
Underlying DBMS error [[Microsoft][SQL Server Native Client 10.0][SQL Server}
No column name was specified for column 2 of 'a'.]
Code:
SELECT shape.STConvexHull() AS MyConvexHull FROM MySpatialTable;
Get help from ArcGIS experts
Download the Esri Support App