Consultor Eletrônico



Kbase 21904: Workaround for the Microsoft SQL Server Identity Field
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   3/20/2002
SUMMARY:

If you have an Identity field in a table in the Microsoft SQL Server, you will get the following error when you try to assign values to that table using the SQL Server DataServer Schema holder:

**<Table-Name.Field_Name> is mandatory, but has unknown(?)
value (110).

EXPLANATION:

The Identity field in the Microsoft SQL Server has the default value
of 1, and its default increment value is also 1 if not otherwise specified in the *Identity Increment* attribute of the field properties. After you create the schema holder using the SQL Server DataServer product and try to assign the value to field(s) other than the Identity field, you will get the above error message.

The reason is the DataServer is not able to recognize the Identity field from the MS SQL Server as an auto-incremental field. Therefore, by having the mandatory flag on in the field properties in the
Progress Data Dictionary, it generates the error.

SOLUTION:

The workaround to bypass the above error is to uncheck the mandatory attribute from that particular field properties in the Progress Data Dictionary, save it, and commit the change. Follow these steps to change the mandatory flag for the Identity field:

1) Go to the Progress Data Dictionary while connected to the Schema
holder. NOTE: You do not have to be connected to the MS SQL
Server Database.

2) Choose the Identity field that was carried out to the Progress
schema holder by the schema pull.

3) Click the field properties to get to the Field Properties Screen.

4) Uncheck the Mandatory flag, save the change, and click OK.

5) Click the Edit menu on the Data Dictionary screen and choose
"Commit Transaction" to commit the change.