Select to view content in your preferred language

Disallow Null Value field in existing data

6409
15
04-13-2021 10:35 AM
AlexP_
by
Regular Contributor

Hello,

I have arcigis pro 2.7.2, arcmap 10.7.1, existing sde feature class, sql server.

Is there a way to disallow null values in field setting since it has existing data? Need to have one field that is required entry. It is not register as version. Please advise. Thank you.

Alex

0 Kudos
15 Replies
AlexP_
by
Regular Contributor

@VinceAngelo thank you for clarify. i don't have any data on that column. i recent checked..

0 Kudos
VinceAngelo
Esri Esteemed Contributor

If every row has a NULL value in that column, you certainly don't want to assert a NOT NULL on the column until the table has been updated so that only valid (non-NULL) values are present.

- V

Dlouhyj
New Contributor

... and when I have versioned table? Thank You

0 Kudos
AdminNCCMA
New Contributor III

@VinceAngelo Hi Vince, we've found this post quite interesting and have ran your query above and it seemed to work, however when we then check the table in catalog it is still set to allow null values. We then viewed the sde_column_registry table and can't see where the allow/not allow nulls is referenced? In screen shot it is the CreatedBy_temp field that we ran the ALTER TABLE query on.

AdminNCCMA_0-1661914867747.png

 

 

0 Kudos
VinceAngelo
Esri Esteemed Contributor

Changes made to the base table are not manifested to SDE table metadata immediately. You must first connect as the owner and describe the table (this can only be done as the owner).

You do not want to do this if the table is registered as versioned.

- V

AndyEgleton
New Contributor II

Hi Vince,

Can you describe the Describe process?

I've tried in the DB and in ArcGIS and it doesn't pick up the change in metadata.

Thanks

0 Kudos