Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. AWS
  3. Question
AWS

How sql server string concatenation done for large strings?

Asked by Cameron Oliver Apr 30, 2021 1.5K views 1 answer
Share

About this question

I am trying to concatenates strings in T-SQL like 'This is a test ' + CHAR(13) + CHAR(10) + ' string' When the string is long (I do not know the limit), I get an error: Some part of your SQL statement is nested too deeply. Rewrite the query or break it up into smaller queries. How can I work around this? How is the SQL statement "nested"? Should I switch to 0x???? notation if the string length is exceeding some value?

This question was asked 10 years earlier on https://social.msdn.microsoft.com/Forums/sqlserver/en-US/e7244cf6-049e-4b8a-b230-226fdd96a694/large-string-concatenation?forum=transactsql without getting a satisfactory answer edit

  • The total string to insert (with the concatenations and ':s) is 369711 chars long.
  • There are 6301 instances of char(13) and the same of char(10).
  • There are 19050 instances of +, not all necessarily used as concatenation operator.
  • What is SQL Server string concatenation?

Your answer

1 Answer

More AWS discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest AWS Blogs

Guides, tips and career advice on AWS from JanBask experts.