You need to edit the script used to create the DDL commands.
I have a similar problem, with EA creating datetime2(0) datatypes incorrectly in SQL Server (MSS). Here is the documentation that shows how to fix my issue; you will need to do something similar.
Problem: In the column properties, when user sets the data type to datetime2 and a length of 0, EA is generating a create-table DDL script that gives the datatype of “datetime2”, not “datetime2(0)”.
In Microsoft SQL Server, the datatypes datetime2(0) and datetime2 are not the same. (The number in “datetime2(#)” specifies precision, which is 0 to 7 digits, with an accuracy of 100ns. The default precision is 7 digits.)
The following script gives the results shown below.
declare @d1 datetime2(7)
,@d2 datetime2(0)
,@d3 datetime2
select @d1 = GETDATE()
,@d2 = GETDATE()
,@d3 = GETDATE()
select @d1 as 'datetime2(7)'
,@d2 as 'datetime2(0)'
,@d3 as 'datetime2'
datetime2(7) datetime2(0) datetime2
--------------------------- ------------------------ ---------------------------
2018-08-08 14:49:21.1300000 2018-08-08 14:49:21 2018-08-08 14:49:21.1300000
It is therefore necessary to generate DDL statements for SQL Server that specify “datetime2(0)” when the user specifies a length of 0. Enterprise Architect is generating “datetime2” however.
All generated DDL scripts would therefore need to be corrected before use.
Solution: It is necessary to open the “DDL Template Editor” tab, to change the scripts used to generate DDL statements.
EA14: Use Code \ Schema \ DDL \ Edit the DB Schema (DDL) Templates.
EA15: In the Find Command bar above the ribbon, type “DDL”, and chose Template; this opens the “DDL Template Editor” tab.
Select the “DDL Data Type” value from the template drop down if available.
Select the required database type from the Language drop down if available.
Sort results by clicking the Name column header.
Select the “DDL Column Definition” template.
Modify the code starting about line 10, as shown below. Since the templates appear to be specific to the Language (e.g. SQL Server 2012), this should not affect models for other databases. It will be necessary to make this correction in every EA project file.
%if $Size=="1"%
$LENGTH = %columnProperty:"LENGTH"%
%if $LENGTH != "" and $LENGTH != "0"%
(
$LENGTH
)
$remark = "2018-08-15 Modification by Dale Fox"
$remark = "This elseIf block fixes the generation for datetime2(0)"
$remark = "data types for SQL Server"
%elseIf $LENGTH != "" and $LENGTH == "0" and $Type=="datetime2"%
(
$LENGTH
)
%endIf%
Click Save.