Select to view content in your preferred language

How to change order in fields in sde FC

604
5
06-10-2019 09:09 AM
JoseSanchez
Regular Contributor

Hello everyone,

Is there a way to change move a field in a FC to be listed in the 3rd position instead of the 10th position?

Thanks

0 Kudos
5 Replies
RobertBorchert
Frequent Contributor III

Easily, no there is not and this has been a point of contention for quite a few years.

There are ways to do it with Python as I have seen posted.

However, for me the easiest way is to make the feature class in a personal Geodatabase.  Unloaded is fine

Open the database in MS Access.  Reorder the fields in Access.

Bring the new world order into your SDE. 

0 Kudos
JoseSanchez
Regular Contributor

Thanks Robert,

When moving  a FC to a PGDB, some attributes change, for example the decimal part of a number, and also it adds additional shape fields.

0 Kudos
RobertBorchert
Frequent Contributor III

How are you doing it?

Make the feature class in the personal.  Import the attributes from the SDE database.  Reorder and make the feature class in SDE.  then use data loader to load direct from SDE to SDE

0 Kudos
JoseSanchez
Regular Contributor

Hi,

I did it in Ms SQL Server, running a "Drop and Create To .."  I just dropped the table and recreated the same table, but this time with the fields  in the right order.

This is the sample I  wrote:

USE [SDE Ms SQL Server Database]
GO

ALTER TABLE [APP].[MyFCToReorder] DROP CONSTRAINT [g2789_ck]
GO

/****** Object:  Table [APP].[MyFCToReorder]    Script Date: 6/10/2019 1:44:37 PM ******/
DROP TABLE [APP].[MyFCToReorder]
GO

/****** Object:  Table [APP].[MyFCToReorder]    Script Date: 6/10/2019 1:44:37 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [APP].[MyFCToReorder](
 [OBJECTID] [int] NOT NULL,
 [FCID] [nvarchar](20) NULL,
 [FieldReordered] [nvarchar](30) NULL,

…..

Hope it helps.

0 Kudos
leomonterol
Esri Contributor

Hi Jose,

You can use the X-Ray add-in for ArcCatalog. This add-in provides the functionality to reorder fields in a Feature Class.

Regards,

Leo

0 Kudos