Expose the ability to use varchar(max) or nvarchar(max)

Description

I have an entity which needs to store long text field (at least 30,000 characters).
I use SQL Server 2005 as back-end database.
SQL Server varchar support up-to 8,000 characters in length of a field, or the reserved word MAX which indicate that the field length will be 2^31-1.

I think that the class SQLServerDialect should be changed to have the following line in it's ctor:

registerColumnType( Types.VARCHAR, 8001, "varchar(MAX)" );

this way, all String fields with length above 8000 will have varchar(MAX) as column type.

Environment

Hibernate 3.4.0GA as provider for JPA 1.0 - SQL Server 2005 Database

Assignee

Strong Liu

Reporter

Ido Ran

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure