When I delete features in SDE, they remain in the database.

2459
2
Jump to solution
10-22-2014 11:37 AM
JoshSaad1
Occasional Contributor II

It seems that when I delete features in SDE, they remain in the database.

I built a quick damage assessment application that consists of the following steps:

  1. Field teams collect points
  2. Geoprocess deletes all existing Damaged Parcels output features using the Delete Features tool (to prevent duplicates when appending data)
  3. Spatial join the collected points with parcel polygons - output is Damaged Parcels
  4. Run Excel report that queries SQL on Damaged Parcels to generate FEMA form

I have steps 2 & 3 run in a geoprocess, but I've found that even after deleting the features, the data still shows up in my report.  I verified this in SQL Server Management Studio.

Because I'm  using the data offline, the feature set is not versioned, but archiving is enabled.

As a workaround I execute a delete query in SQL before running my report so that it comes out clean.  Is there a way to run my delete query in Model Builder so I can incorporate it into my geoprocess?

0 Kudos
1 Solution

Accepted Solutions
RussellBrennan
Esri Contributor

When your data is archive enabled the timestamps on your data are used to determine what the current representation of your data is. We do not actually delete the records, rather we 'mark' them as deleted by setting a timestamp to the current moment. I would strongly caution against running delete queries in SQL before running your report. Rather I would suggest that you use the archive view to access your data or alter your Excel report to only query data that is current (gdb_to_date field = 12/31/9999).

Below are some links to some of the help documentation on accessing your data via SQL.

SQL Access to enterprise geodatabase data.

What is an archive view

The archive process - see the paragraph "Enabling archiving on nonversioned data"

Hope this helps,

Russell

View solution in original post

0 Kudos
2 Replies
RussellBrennan
Esri Contributor

When your data is archive enabled the timestamps on your data are used to determine what the current representation of your data is. We do not actually delete the records, rather we 'mark' them as deleted by setting a timestamp to the current moment. I would strongly caution against running delete queries in SQL before running your report. Rather I would suggest that you use the archive view to access your data or alter your Excel report to only query data that is current (gdb_to_date field = 12/31/9999).

Below are some links to some of the help documentation on accessing your data via SQL.

SQL Access to enterprise geodatabase data.

What is an archive view

The archive process - see the paragraph "Enabling archiving on nonversioned data"

Hope this helps,

Russell

0 Kudos
JoshSaad1
Occasional Contributor II

Thanks for your help.  I found the view and wrote a new report referencing it instead of the database table.  Works just like I want it to.

0 Kudos