Is it OK to change the text length of a column in a featureclass in SDE using SQL? Using

ALTER TABLE <tablename> ALTER COLUMN <columnname> nvarchar(255);

I wonder this because I found some records in sde_column_registry where the column length was not updated, and it does update when I use ArcCatalog. I understand editing in the systemtables is not OK.

From the documentation:

You can use the native SQL of your database management system to edit the simple, nonspatial attribute data in the geodatabase. You can also use the spatial SQL functions installed with spatial types to alter simple spatial data using SQL.

You can use SQL to edit both versioned and nonversioned datasets in enterprise geodatabases. However, as mentioned previously, you should not edit datasets that participate in geodatabase functionality.

But is also states:

If you want your tables to use geodatabase functionality, register the table with the geodatabase. Remember, though, that once the tables use geodatabase functionality, you cannot edit them using SQL.

So now I am not sure if I can alter the existing featureclasses using SQL.

I usually solve this using Python/ArcPy but a colleague prefers to use SQL.

  • 2
    Doing so is unsupported, but it you do it correctly (in all tables) and then update the metadata by describing the table as the owner, it might work. Of greater concern is folks making changes with SQL without understanding the data model. – Vince Feb 5 at 13:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.