FOR XML PATH results in SSMS truncated to 2034 characters

I’m using SQL Server 2008 R2.

I’m concatenating strings together using “for xml path(”)”.

  • SQL primary key, INT or GUID or..?
  • Reading values from SQL database in C#
  • DB2 equivalent of SQL Server's TRIGGER_NESTLEVEL()?
  • SQL Server PIVOT perhaps?
  • ‘error 26 - error locating server’ when launching C# exe located on NW drive from Win7; MSSQL
  • query for first and last day of month
  • I have set the Tools->Options->SQL Server->Results to Grid options to max.

    I have set the Tools->Options->SQL Server->Results to Text options to max.

    Executing the query in Grid mode and copying the one row/one colum results, I see the return value is limited to 2034 characters.

    Executing the query in Text mode and copying the one row/one colum results, I see the return value is limited to 1124 characters.

    How can I ensure the returned value isn’t truncated?

  • Export import of asian languages data in sql server
  • Using if else block in pivot query
  • Disadvantages of SQL Server Service Broker
  • Group By Retrieve 3 Values
  • SSIS package - loop through different connections for Execute SQL task
  • How to debug SQL Server T-SQL in Visual Studio 2012
  • One Solution collect form web for “FOR XML PATH results in SSMS truncated to 2034 characters”

    Answer found here:

    https://stackoverflow.com/a/5658758/609058

    For some reason, converting the XML to a string returns a non-truncated string.

    Not sure why it works, but it does.

    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.