Share via

Cannot post answer

Naomi Nosonovsky 8,906 Reputation points
2023-06-20T19:18:45.7633333+00:00

I am trying to answer a question with this code block and when I try to post I get unexpected error.

Please fix the following issues to continue:

  • We encountered an unexpected error. Please try again later. If this issue continues, please contact site support.
Community Center | Discuss the Q&A site | Get started on Q&A
0 comments No comments

4 answers

Sort by: Most helpful
  1. TP 157.6K Reputation points Volunteer Moderator
    2023-06-20T19:56:56.97+00:00

    Hi Naomi,

    Did you try manually editing the code block in markdown mode? Sometimes the editor messes up the underlying markdown. When in markdown mode you can delete out extra backticks that shouldn't be there, etc., make sure the block has the three opening and three closing backticks, etc.

    -TP

    Was this answer helpful?


  2. Naomi Nosonovsky 8,906 Reputation points
    2023-06-20T19:50:28.0133333+00:00

    By trial and error I found that it's using SELECT twice in the statement that is causing the error.

    Was this answer helpful?

    0 comments No comments

  3. Naomi Nosonovsky 8,906 Reputation points
    2023-06-20T19:32:28.49+00:00

    Tried about 10+ times, I am unable to post a simple SQL string that uses STRING_AGG function.

    Was this answer helpful?

    0 comments No comments

  4. Naomi Nosonovsky 8,906 Reputation points
    2023-06-20T19:30:22.0366667+00:00

    Trying:

    DECLARE @SQL NVARCHAR(MAX);
    
    
     @SQL = STRING_AGG(CONVERT(VARCHAR(MAX),' ID FROM ' + QUOTENAME(s.name+'.'+t.name) + ' WHERE ID = 1234'), CHAR(13)) 	from sys.tables t 	join sys.columns c 	on t.object_id=c.object_id 	join sys.schemas s 	on s.schema_id=t.schema_id 	
    

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.