Forum Discussion

Naveen_Kumar's avatar
Naveen_Kumar
Microsoft Employee
8 years ago

Target string size is too small to represent the XML instance

I have a field which stores query plans(XML data type) ,when i try to show those plans in report using table visualization getting the below mentioned error.

Error: "Target string size is too small to represent the XML instance. The exception was raised by the IDataReader interface."

 

Note: Using SQL Server Direct Query method to load the data into reports .

 

any help will be appriciated .

 

6 Replies

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Microsoft Employee

    Hi Naveen_Kumar,

     

    It seems this issue is from the Server side. I tested with two versions of the Desktop. No issues. Please refer to problem-with-managed-code-simple-example-target-string-size-is-too-small-to-represent-the-xml. Please upgrade your Desktop to the latest version.

     

    My test environment:

    1. SQL Server 2016;

    2. Direct Query mode in the Desktop 2.55.5010.621 64-bit (February 2018);

    3. A Sql table with one column of type xml;

    4. Created a table visual.

    Target_string_size_is_too_small_to_represent_the_XML_instance

     

     

    Best Regards,

    Dale

    • Naveen_Kumar's avatar
      Naveen_Kumar
      Microsoft Employee

      Hi v-jiascu-msft

       

      I'm using latest Desktop version (feb 2018) only but with Azure sql server . the avg size of xml field is 162340 Bytes

       

      My test environment:

      1. Azure SQL Server

      2. Direct Query mode in the Desktop 2.55.5010.621 64-bit (February 2018);

      3. A Sql table with one column of type xml;

      4. Created a table visual.

      • Naveen_Kumar's avatar
        Naveen_Kumar
        Microsoft Employee

        Hi v-jiascu-msft

         

        When i used SQL server Import method to get the data into report it is working as expected. As the size of the report is limited (in Import) we cannot use this approach . Please suggest

         

        Thanks & Regards,

        Naveen.