Efcore: stringlength does not have effect on DB

Created on 17 May 2020  路  2Comments  路  Source: dotnet/efcore

im having a sql db in azure. i have a string column where the string length displays "max", but in the code i have set the string length to 5000.please help. im using code first migration.

image

image

context model snapshot

image

closed-question customer-reported

Most helpful comment

The maximum number of byte-pairs for an nvarchar column is 4000. See these docs. Anything above that is treated as max.

All 2 comments

The maximum number of byte-pairs for an nvarchar column is 4000. See these docs. Anything above that is treated as max.

If you make your column non-unicode, the max size is 8000.

Was this page helpful?
0 / 5 - 0 ratings