Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 :(

like image 679
Terje Solem Avatar asked Jun 13 '19 15:06

Terje Solem


People also ask

How can I get specific data from JSON in SQL?

To query JSON data, you can use standard T-SQL. If you must create a query or report on JSON data, you can easily convert JSON data to rows and columns by calling the OPENJSON rowset function. For more information, see Convert JSON Data to Rows and Columns with OPENJSON (SQL Server).

How can I get specific data from JSON?

Getting a specific property from a JSON response object Instead, you select the exact property you want and pull that out through dot notation. The dot ( . ) after response (the name of the JSON payload, as defined arbitrarily in the jQuery AJAX function) is how you access the values you want from the JSON object.

Does SQL return JSON data?

The FOR JSON AUTO keywords at the end of the SQL statement causes SQL Server to return JSON rather than a rowset. One of the first things to notice is that a single read using FOR JSON AUTO returns all the selected rows as an array of JSON objects.


1 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.

like image 76
Terje Solem Avatar answered Oct 06 '22 20:10

Terje Solem