How do I set a column in SQL Server to varchar(max) using ASP.net EF Codefirst Data Annotations?

[Column(TypeName = "varchar(MAX)")]

Surprisingly the most obvious solution works.

The [MaxLength] attribute only creates a varchar column with a max length that isn’t MAX but – in my case (SQL Server Express 2008 R2) – 8000.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)