I'm unable to connect to one of our enterprise databases. This problem first presented 4 days ago. I believe, but I'm not sure, that this was coincident with an edit session on this connection. The full message displayed by the ArcMap Connect popup is:
Failed to connect to database. Target state not found in the STATES table [sde.DEFAULT][STATE_ID = 623].
These are the results of queries against the SQL Server database state tables:
SELECT TOP (1000) [lineage_name]
,[lineage_id]
FROM [Community].[sde].[SDE_state_lineages]
lineage_name | lineage_id | |
---|---|---|
1 | 0 | 0 |
2 | 267 | 622 |
SELECT TOP (1000) [state_id]
,[owner]
,[creation_time]
,[closing_time]
,[parent_state_id]
,[lineage_name]
FROM [Community].[sde].[SDE_states]
state_id | owner | creation_time | closing_time | parent_state_id | lineage_name | |
---|---|---|---|---|---|---|
1 | 0 | sde | 2016-08-16 10:42:47.000 | 2016-08-16 10:42:47.000 | 0 | 0 |
2 | 622 | GISADMIN | 2018-10-23 16:40:19.870 | 2018-10-23 16:40:26.870 | 265 | 267 |
A possible solution would be to add a record to the SDE_state_lineages table having a lineage_id of 623 and also add a record to the SDE_states table having a state_id of 623. I'm reluctant to do this though as I'm not sure that this will not cause inconsistencies between these tables and any possible related tables.
Our organisation is running ArcGIS Desktop 10.5 with a SQL Server 2014 SP2 database on Windows 2012 R2.
I've added a record to each of the SDE_state_lineages and SDE_states table as I proposed above and this has fixed our connection to this database.