Cannot create required field in SDE with Python

Discussion created by bveldkamp on Dec 18, 2013
Latest reply on Dec 19, 2013 by bveldkamp

The following code works on an FGDB, but if I execute it on an SQL Server database, it fails with the error: "The column must not have a NOT NULL constraint [The column must not have a NOT NULL constraint[VRA.DBO.test.Test]]".

arcpy.CreateTable_management(gdb, tableName)
arcpy.AddField_management(path.join(gdb, tableName), "Test", "TEXT", "0", "0", "36", "Test", "NON_NULLABLE", "REQUIRED", "")

A workaround would be to create the table in scratchGDB first, and then copy it to SQL Server (this works), but it seems to me that that shouldn't be necessary. Am I overlooking something obvious?