Where are query layers stored?

748
2
Jump to solution
05-17-2013 02:00 PM
JimmyDobbins
New Contributor III
I have successfully created 3 query layers that show the most recent vessel positions in a tracking application I am building.
Well, the dialog says the query layer creation is successful, however, I cannot find the created objects. I would like to serve these query layers using ArcGIS Server in a web application. I have tried the following, to no avail:

  1. looking within the database connection in ArcCatalog used to create the query layer

  2. looking within the database connection in ArcCatalog (using the "sa" account)

  3. looking through SQL Server Management Studio (using the "sa" account so I would have all possible permissions)

I am using SQL Server 2012 with ArcSDE and ArcCatalog 10.1.

Does anyone have any other suggestions as to where these layers might be and why I can't see them? Are there any SQL Server gurus who might know a trick for finding the newly created objects?

Thanks in advance!
0 Kudos
1 Solution

Accepted Solutions
MarcoBoeringa
MVP Regular Contributor
Query Layers are like "normal" layers in the sense that they are persisted inside your MXD in the TOC (Table Of Contents) as a "layer". Each time you open the MXD or do something else, the query will be re-run against the database. If you want the same SQL statement to be persisted in the database, you should right click the Database Connection in ArcCatalog, and choose "New\View" and paste the SQL statement / code there. It will create a normal database view that persists at the database level.

If you want to re-use the layer object in another MXD, save it as layer file outside the MXD on a file system and use that.

View solution in original post

2 Replies
MarcoBoeringa
MVP Regular Contributor
Query Layers are like "normal" layers in the sense that they are persisted inside your MXD in the TOC (Table Of Contents) as a "layer". Each time you open the MXD or do something else, the query will be re-run against the database. If you want the same SQL statement to be persisted in the database, you should right click the Database Connection in ArcCatalog, and choose "New\View" and paste the SQL statement / code there. It will create a normal database view that persists at the database level.

If you want to re-use the layer object in another MXD, save it as layer file outside the MXD on a file system and use that.
JimmyDobbins
New Contributor III
Thanks so much for the clear explanation. Being able to create a query layer within ArcCatalog made me think it was a persistent object. Thanks again, the view creation tip did the trick!
0 Kudos