Starting with SQL Server2005, a new data type XML type is provided that allows the user to store data directly into a datasheet in the format of an XML file. Combined with LINQ to SQL in asp.net, we can easily store XML files in a SQL Server database. However, by default, if you store an XML file that is larger (more than 2MB), you cannot click to view the XML content directly in SQL Server Manager and report the following error message:
How do you solve the problem? Very simply, in fact, the error hint has been described clearly, click on the Tools menu in SQL Server Management Studio to select Options. Then find the corresponding setting node in the figure below to change the maximum character limit of XML data to unlimited (unrestricted).
By default, SQL Server returns more than 2MB of XML data content in Management Studio in order to improve query efficiency, and if the contents of the XML file you store are greater than 2MB, the remaining characters are automatically truncated to make an error when you open it.