DBMS error - 42s02 invalid object name invalid for use as a key in an index

1242
6
02-17-2020 01:20 AM
NicolasRoux
New Contributor

Hi everyone !

I try to copy GDB file content (no creator on that source) on SDE GBE. The GDB File is build with relations table. I use "drag and drop" action to copy the files.

The copy was interrupted due to one file (table file) that the type is invalid for uses as a key colomn in an index (abstract of the error message 😉 ).

This file is set up with a key column built like 1111111-1/1 (varchar) and wide as 8000 characters.

I think that :

1- the key column is not right.

2- The field is too wide for the transaction.

Am I right or not ?

Thanks for reading and answering !

Nicolas

0 Kudos
6 Replies
WilliamCraft
MVP Regular Contributor

If the field is a VARCHAR, then you can have up to 8000 characters.  Check to see if the column definition uses VARCHAR(MAX).  If it does, try using a limited size rather than MAX.  What version of SQL Server are you using?  There is a limitation in SQL Server (depending on the version) that VARCHAR(MAX) and NVARCHAR(MAX) cannot be used in indices.  Instead, a fixed length must be used to make it eligible for use in the index.

0 Kudos
NicolasRoux
New Contributor

Hi William,

The column definition uses VARCHAR(MAX), up to 8000 characters. The SQL Server version is 2016 (don't SP version as well).

0 Kudos
WilliamCraft
MVP Regular Contributor

Change the column definition from VARCHAR(MAX) to something else with a suitable length such as VARCHAR(100).  Let me know if it works after that.  

0 Kudos
NicolasRoux
New Contributor

After the change, it didn't work. I get the same error message.

0 Kudos
WilliamCraft
MVP Regular Contributor

After making the change, did you close and re-open ArcGIS Desktop?   

0 Kudos
NicolasRoux
New Contributor

Hi,

Sorry for my late response... Yes, I did it.

And I asked to the table owner changing the length field.

Thanks for your answers 😉

0 Kudos