sql server for json auto. How to get all of result

Viewed 2497

When trying this:

select BtId, [Name], Type, ISNULL([Description], '') as [Description], 
ISNULL(Comment, '') as Comment, ISNULL(Source, '') as Source, ISNULL(Info, '') as Info

from BytegymType
For json auto

I get this error message:

Unable to show XML. The following error happened:
An error occurred while parsing EntityName. Line 1, position 14957.
One solution is to increase the number of characters retrieved from the 
server for XML data. To change this setting, on the Tools menu, click 
Options.

I have set the sql result to max:

Microsoft SQL Server Management Studio 14.0.17289.0

The non-xml data i cant get over 655535 either.. I tried also result to file, still missing stuff.

Sorry I'm not too good with sql-server :(

2 Answers

I found the error after going narrowing down the results. It had nothing to with the buffersize. The for json seems to have problems with the & sign, which i had stored in the db. It's kinda weird cause it did have release characters for / The sentence was "Shoulders & Triceps".

Seems the parser is buggy.

As an alternative, Azure Data Studio returns correct json result even if the data contains an ampersand (&).

Related