Select to view content in your preferred language

Allow Null grayed out

6807
6
Jump to solution
05-27-2022 10:26 AM
Syvertson
Frequent Contributor

I am trying to customize my database to include better quality control.  There are some fields that I never want null.  So, I go to "field design" and attempt to unselect the "Allow NULL"  option in the fields I would like to never have blank, but they are all "grayed out" and I cannot change them.  See the screen shot below:

MatthewSyvertson_0-1653672362382.png

 

Any ideas how I can fix this issue?

0 Kudos
1 Solution

Accepted Solutions
Robert_LeClair
Esri Notable Contributor

Is your database a file geodatabase by chance?  My guess is this is not availabe in the file geodatabase format.  If you are using a RDBMS such as SQL Server, you can use SQL Server Management Studio to set a "not null constraint" on an attribute field.  

In SQL, it would be:
alter table <owner>.<feature class>
alter column <column name> int not null

Hope this helps!

View solution in original post

6 Replies
DanPatterson
MVP Esteemed Contributor

If the gdb contains data, it can't be changed

Modify field properties—ArcGIS Pro | Documentation


... sort of retired...
Robert_LeClair
Esri Notable Contributor

Is your database a file geodatabase by chance?  My guess is this is not availabe in the file geodatabase format.  If you are using a RDBMS such as SQL Server, you can use SQL Server Management Studio to set a "not null constraint" on an attribute field.  

In SQL, it would be:
alter table <owner>.<feature class>
alter column <column name> int not null

Hope this helps!

Syvertson
Frequent Contributor

This worked.  Thank you.

Laura
by MVP Regular Contributor
MVP Regular Contributor

I am trying to complete this for a table (in a SDE). Can you tell me what is wrong?

Laura_0-1702994897992.png

 

0 Kudos
Robert_LeClair
Esri Notable Contributor

Yes, remove the < and > - these are not needed rather just to indicate it's an owner name and table.  Based upon your text it would be:

alter table mcgis.service
alter column guid int not null

Let me know if this works for you or not.  Thx!

vijaybadugu
Frequent Contributor

I ran same SQL Statement to alter field properties and it is showing as expected in SQL Server Management Studio. when I try to open EGDB in ArcGIS Pro , It shows Allow NULL as checked and does not change and it is in disable mode 

0 Kudos