Can't see feature class in ArcSDE but it's in SQL Server DB

389
3
10-05-2012 12:56 PM
ChrisBeaudette
Occasional Contributor
I have a feature class that through a series of unfortunate events, I can no longer see it in ArcCatalog.  However I have a backup in another geodatabase and when I try to copy the backup fc to my original geodatabase, it complains that it already exists.  And indeed it is visible in SQL Server Mgmt Studio, but doing 'sdelayer -o describe_long' or arcpy.ListFeatureClasses does not display the feature class.

I'm using SQL Server 2008 SP3 and ArcSDE v10.0.  The series of "unfortunate events" includes updating a field value using TSQL and running a delete_features tool against it.

Any ideas how I can remove the feature class so that ArcSDE is no longer half aware of it?
0 Kudos
3 Replies
VinceAngelo
Esri Esteemed Contributor
There's a number of safe and less safe method to tackle this issue,
but the safest sequence would be:

First off, make sure you have a current backup. 

Then use 'sdetable -o delete' (as the owner)

Then use SQL to create a table with that name

Then use Catalog to delete it again.

Finally, you can copy the table back into the database.

Keep in mind that this will restore a single table.  If it was part of a
versioned feature dataset, contact Tech Support for the best method
to retain as much data as possible.

- V
0 Kudos
ChrisBeaudette
Occasional Contributor

. . .

First off, make sure you have a current backup. 

Then use 'sdetable -o delete' (as the owner)

. . .

- V


Thanks Vince.

Tried this:
>sdetable -o delete -t CityLimits -s SERVER_NAME -i sql:sqlserver:SERVER_NAME
 -D DATABASE_NAME -u TABLE_OWNER -p OWNER_PWD


But got this:
Delete table CityLimits! Are you sure? (Y/N): Y
        Error: Underlying DBMS error (-51).
        Error: Unable to delete table CityLimits.
Microsoft SQL Server Native Client 10.0: No value given for one or more required parameters.


FYI, not using a versioned db.

Google did not turn up any ideas.  Any thoughts on that error?

Also, looks like the table is actually visible w/ '-o describe'.

Thanks again,

Chris
0 Kudos
VinceAngelo
Esri Esteemed Contributor
Does another table reference this table with a foreign key constraint?

I've never seen that error before, but I don't use SQL-Server as often
as other RDBMSes.  You probably want to check the database logs, and
if that does not provide more information, contact Tech Support.

- V
0 Kudos