This section describes how to create tables with CLOB (VARCHAR(MAX)) columns in SQL Server server.
SQL Server support CLOB with the regular VARCHAR data types, but with a special length value called MAX:
VARCHAR(MAX) - A CLOB column with a maximum length of (2**31 - 1) bytes (not characters), about 2GB.
In order to test CLOB columns in SQL Server server, I used the SQL Server commnand line interface
to create a test table with one CLOB column:
C:\>sqlcmd -S localhost -U Herong -P TopSecret
1> -- Set AdventureWorksLT as the current database
2> USE AdventureWorksLT;
3> GO
1> -- Create the test table with a CLOB column
2> CREATE TABLE Article (ID INTEGER PRIMARY KEY IDENTITY,
3> Subject VARCHAR(256) NOT NULL,
4> Body VARCHAR(MAX));
5> GO