geocom-gis / GeocomDatabaseManagementTools

Geocom Database Management Tools help to create enterprise geodatabase, set database permissions, version data and manage other database tasks. These are standard tools used by Geocom Informatik AG.
GNU General Public License v3.0
6 stars 4 forks source link

Invalid object name 'sde.SDE_table_registry' #3

Closed rbovard closed 5 years ago

rbovard commented 5 years ago

Hi @thbuchmann,

I encounter an issue while running SetSpatialIndexesGeometryMSSQL script:

Invalid object name 'sde.SDE_table_registry'

The full trace:

(u'42S02', u"[42S02] [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'sde.SDE_table_registry'.")
Failed script SetSpatialIndexesGeometryMSSQL...

Traceback (most recent call last):
  File "GeocomDatabaseManagementTools\py\gc_egdb_set_spidx_geom_mssql.py", line 249, in <module>
    main(*argv)
  File "GeocomDatabaseManagementTools\py\gc_egdb_set_spidx_geom_mssql.py", line 180, in main
    table = select(sql,instance,database,dbms_admin,dbms_admin_pwd)
  File "GeocomDatabaseManagementTools\py\gc_egdb_set_spidx_geom_mssql.py", line 63, in select
    return cursor.fetchone()
  File "GeocomDatabaseManagementTools\py\pypyodbc.py", line 1914, in fetchone
    check_success(self, ret)
  File "GeocomDatabaseManagementTools\py\pypyodbc.py", line 986, in check_success
    ctrl_err(SQL_HANDLE_STMT, ODBC_obj.stmt_h, ret, ODBC_obj.ansi)
  File "GeocomDatabaseManagementTools\py\pypyodbc.py", line 964, in ctrl_err
    raise Error(state,err_text)
Error: (u'HY010', u'[HY010] [Microsoft][Gestionnaire de pilotes ODBC] Erreur de s\xe9quence de la fonction')

The database is SQL Server 2017.

thbuchmann commented 5 years ago

Hi @rbovard, as you can find under Known issues:

Geocom Database Management Tools do not support Esri Workgroup license.

But you can adapt /py/gc_sql_utils.py - Lin 137 to:

FROM dbo.SDE_table_registry

Best, @thbuchmann

rbovard commented 5 years ago

Hi @thbuchmann,

Thanks a lot for your quick workaround, it worked well!

I didn't think about this limitation, since I didn't have a problem with the old script for indexes and it worked well with the same license level.

Best regards.

PS: You can close this issue or not if it's relevant to keep it opened.

thbuchmann commented 5 years ago

Hi @rbovard,

no problem - I think your old script was already adapted ;-)

I'll close the issue. If you have further problems, please let us know.

Best, @thbuchmann

rbovard commented 5 years ago

Oh, I just checked it and the schema was not defined:

getTableId = """
            SELECT registration_id,imv_view_name
            FROM SDE_table_registry
            WHERE table_name = '{tablename}'
            """

Is there any reason why you added it?

thbuchmann commented 5 years ago

You're right! for Workgroup there's not always the need to define the "dbo"-scheme because it's the "default"-scheme if you're working with sa-permissions.