Spatial Views with Attachments (SQL Server Express 2008 R2)

4914
2
02-17-2015 01:42 PM
JennB
by
New Contributor III

Hi everyone,

I've successfully created a spatial view of a feature class stored in one of the project's GDBs. However, this particular feature class has attachments and I don't particularly want to lose that information (in fact, we can't! It's needed for the project). My initial question:

  • Can you even maintain attachments using spatial views (so, for example, when you use the Info tool on a polygon from the view you can still see its attachments)

If that's possible, how? I've tried to create a view running the following SQL and the view returns 0 results.

CREATE VIEW BridgeDecks
 AS
 SELECT
  br.OBJECTID,
  br.STR_NAME,
  br.Shape,
  brAtt.REL_OBJECTID,
  brAtt.ATTACHMENTID,
  brAtt.ATT_NAME,
  brAtt.CONTENT_TYPE,
  brAtt.DATA,
  brAtt.DATA_SIZE
  
 FROM ProjName_Assets.dbo.ProjName_BRIDGEDECKS_MASTER AS br,
  ProjName_Assets.dbo.ProjName_BRIDGEDECKS__ATTACH AS brAtt
  
 WHERE br.OBJECTID = brAtt.REL_OBJECTID
 AND br.OBJECTID IS NOT NULL;

Any pointers would be just wonderful! Some notes for clarification...

ProjName_BridgeDecks_Master is the feature class

ProjName_BridgeDecks__Attach is the table

ProjName_BridgeDecks__AttachRel is the relationship class that appears in  ArcCatalog, though it's not used in this sql

0 Kudos
2 Replies
CarlosKrefft
Occasional Contributor

Where you able to figure this out? I'd like to know the same thing.

by Anonymous User
Not applicable

Attachments are enabled on a feature class, but aren't actually stored in the feature class. There is a relationship class to a table, where the attachments for each feature get stored. 

Enabling attachments—ArcGIS Help | ArcGIS for Desktop 

I tried to create a view that would preserve attachments (i.e. create a join that adds the BLOB fields from the attachments table to the view), but unfortunately that was not successful. Additionally, it is not possible to create a relationship class from a view to the original attachments table because views aren't registered with the geodatabase

Views in an enterprise geodatabase—Help | ArcGIS for Desktop 

Ultimately, attachments are designed to be enabled on feature classes not views.