Hi,
I seem to be having difficulty creating a spatial view in SQL Server. The format I use is basically identical to the example in the Help, but I am getting this error:
Msg 102, Level 15, State 1, Procedure spvw_TEST, Line 2
Incorrect syntax near ','.
Does anyone know why it would be complaining about a comma (it is the first comma after "vw.FieldID" below)? Here is an abbreviated version of the code I am trying to run:
CREATE VIEW spvw_TEST
AS SELECT (vw.FieldID,vw.Field1,vw.Field2,fc.Shape)
FROM vw_AllMain vw JOIN FeatsDistrib fc
ON vw.txtFeatID = fc.txtFeatID
Thanks,
Justin
Solved! Go to Solution.
In this case, I believe that it has a problem with the parentheses. In this case, SQL Server is expecting an expression or subquery where the field names are. I was able to successfully run this query by first removing the parentheses. Can you try removing the parentheses and running it again?
CREATE VIEW spvw_TEST
AS SELECT vw.FieldID,vw.Field1,vw.Field2,fc.Shape
FROM vw_AllMain vw JOIN FeatsDistrib fc
ON vw.txtFeatID = fc.txtFeatID
In this case, I believe that it has a problem with the parentheses. In this case, SQL Server is expecting an expression or subquery where the field names are. I was able to successfully run this query by first removing the parentheses. Can you try removing the parentheses and running it again?
CREATE VIEW spvw_TEST
AS SELECT vw.FieldID,vw.Field1,vw.Field2,fc.Shape
FROM vw_AllMain vw JOIN FeatsDistrib fc
ON vw.txtFeatID = fc.txtFeatID
Well that worked like a charm; thanks!
I guess ESRI should consider revising their Help section here: ArcGIS Help (10.2, 10.2.1, and 10.2.2)
Glad that I could help. I just submitted a ticket for that document to be reviewed.