[Solution] the length of the LOB data to be copied exceeds the configured maximum value.

Source: Internet
Author: User
Tags management studio sql server management sql server management studio
During SQL Server 2005 database usage, JDBC Driver exception: com. microsoft. sqlserver. jdbc. SQLServerException: the length of the LOB data to be copied (144377) exceeds the configured maximum of 65536.

 

  Query a lot of information and provide a solution on the Internet, hoping:

  

  After searching for some information, we found that one of the server configuration options"Max Text Repl Size" ("Max Text copy Size"). Its default value is 65536. You can modify this value to solve the above problem.

SELECT * FROM sys. tolerations where name like '% repl %'

The maximum value of max text repl size (B) is 2147483647. You can set the value smaller than or equal to this value according to the actual situation.

For example:

 

EXEC sp_configure 'show advanced options', 1
Go
Sp_configure 'max text repl size', '20140901'
Go
RECONFIGURE

 

The reason for online data query is that SQL SERVER sets an UPDATE, INSERT, WRITETEXT, and UPDATETEXT statement in replication to add the maximum data volume to the replication column65536Byte (64 k), for columns with a data volume greater than 64 k, it is not automatically intercepted, but cannot be inserted or updated to ensure data integrity. The solution is as follows:

You can use the max text repl size Option to reset the data size (in bytes) of the text and image Fields ). The default value is 64 KB and the maximum value is 2 GB. This option is only applicable to transaction replication. This option is ignored during snapshot copy and merge copy. This setting takes effect immediately without restarting the server. Method 1:
In SQL Server Management Studio, configure the max text repl size Option: 1. In object Resource Manager, right-click the Server and select "properties ".
2. Click the "advanced" node.
3. Under miscellaneous, change the "maximum text copy size" option to the required value. Method 2:
Use sp_configure to modify the max text repl size value. Run the following command in the query Analyzer: Sp_configure 'max text repl size', '20140901'This command re-sets the max text repl size to 2 GB (that is, sets the storage capacity of the image field to 2 GB). Note: Command Format: sp_configure 'name of the configuration option ''' option value'

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.