You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATETABLELiquidityPlanning.Parameters
(
Id int IDENTITY(1,1) NOT NULL,
Name nvarchar(80) NOT NULL,
Description textNULL,
Value intNULL,
DefaultValue intNULL
);
The length of the TEXT type is not necessary. Length 2147483647 is the max length of a 4 byte integer. I my opinion, the max length should not be put into the SQLAlchemy model in this case.
The text was updated successfully, but these errors were encountered:
Does a TEXT column always have a length on SQL Server? Sqlacodegen doesn't know if the length is necessary, it just copies whatever parameters it gets from the reflected metadata.
@agronholm No. TEXT by default is not limited. When you create a table, it is common to use CREATE my_table ( column_name TEXT NULL ).
The official documentation for type TEXT (and NTEXT) does not document an option to specify the length explicitly - but for varchar/nvarchar it is documented (see here).
I have the following MSSQL table:
This generates the following file:
The length of the TEXT type is not necessary. Length 2147483647 is the max length of a 4 byte integer. I my opinion, the max length should not be put into the SQLAlchemy model in this case.
The text was updated successfully, but these errors were encountered: