sqlcmd: The size (65535) given to the column 'x' exceeds the maximum allowed

  • Hello

    I am trying to copy SQL Server table with varchar(max) to Amazon Redshift. There is no direct connection, I have to save data to file and load data from the file.

    The maximum length for VARCHAR in Redshift is 65535 bytes

     SELECT LEFT(CAST('ABC' AS VARCHAR(MAX)), 65535) AS Col;

    sqlcmd -i "select.sql" -o "out.txt"

    Msg 131, Level 15, State 2, Server XYZ, Line 4

    The size (65535) given to the column 'x' exceeds the maximum allowed for any data type (8000).

  • Please close. It works now.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply