Error: No column name was specified for column [n] of 'a'
【相关信息】
Article ID: 44148
Software:
ArcGIS - ArcEditor 10
ArcGIS - ArcInfo 10
ArcGIS - ArcView 10
ArcGIS for Desktop Advanced 10.2, 10.1, 10.2.1, 10.3, 10.3.1, 10.2.2
ArcGIS for Desktop Basic 10.2, 10.2.1, 10.3, 10.3.1, 10.2.2, 10.1
ArcGIS for Desktop Standard 10.2.1, 10.1, 10.2, 10.3.1, 10.2.2, 10.3
Platforms: N/A
【错误信息】
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:
SELECT objectid, shape.STConvexHull() as shape2 FROM sde.mySpatialTable
A database trace returns:
exec sp_prepare @p1 ...,N'select shape2 from (SELECT objectid, shape.STConvexHull() as shape2
FROM sde.mySpatialTable) a',1
If an alias is not provided for the STConvexHull() computed column in the Query Layer dialog, such as in the case below:
SELECT objectid, shape.STConvexHull() FROM sde.mySpatialTable
an error occurs.
Underlying DBMS error [[Microsoft][SQL Server Native Client 10.0][SQL Server}
No column name was specified for column 2 of 'a'.]
Article ID: 44148
Software:
ArcGIS - ArcEditor 10
ArcGIS - ArcInfo 10
ArcGIS - ArcView 10
ArcGIS for Desktop Advanced 10.2, 10.1, 10.2.1, 10.3, 10.3.1, 10.2.2
ArcGIS for Desktop Basic 10.2, 10.2.1, 10.3, 10.3.1, 10.2.2, 10.1
ArcGIS for Desktop Standard 10.2.1, 10.1, 10.2, 10.3.1, 10.2.2, 10.3
Platforms: N/A
【错误信息】
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:
SELECT objectid, shape.STConvexHull() as shape2 FROM sde.mySpatialTable
A database trace returns:
exec sp_prepare @p1 ...,N'select shape2 from (SELECT objectid, shape.STConvexHull() as shape2
FROM sde.mySpatialTable) a',1
If an alias is not provided for the STConvexHull() computed column in the Query Layer dialog, such as in the case below:
SELECT objectid, shape.STConvexHull() FROM sde.mySpatialTable
an error occurs.
Underlying DBMS error [[Microsoft][SQL Server Native Client 10.0][SQL Server}
No column name was specified for column 2 of 'a'.]
1 个回复
易智瑞技术支持
赞同来自:
Ensure computed columns receive a column alias. See the example below.
SELECT shape.STConvexHull() AS MyConvexHull FROM MySpatialTable;
【创建及修改时间】
Created: 2/25/2015 Last Modified: 11/18/2015
【原文链接】
http://support.esri.com/en/kno ... 44148
要回复问题请先登录或注册