The TO value is probably fine because it is quoted, but the PR (price) value is not.
Where/how are you seeing this error?
I have parsed Order Tags before using SQL JSON functions and I don’t remember seeing this error.
EDIT: I see the error now in the following query; strange that I did not notice this before. Maybe because my Tag Prices never use to contain decimals.
SELECT
[Id]
,[TicketId]
,[MenuItemName]
,[PortionName]
,[Price]
,[Quantity]
,tagName
,tagValue
,tagPrice
,tagNote
--,[OrderTags]
,[OrderStates]
,[MenuItemId]
--,[PortionCount]
--,[Locked]
--,[CalculatePrice]
--,[DecreaseInventory]
--,[IncreaseInventory]
--,[OrderNumber]
--,[CreatingUserName]
--,[CreatedDateTime]
--,[LastUpdateDateTime]
--,[AccountTransactionTypeId]
--,[ProductTimerValueId]
--,[GroupTagName]
--,[GroupTagFormat]
--,[Separator]
--,[PriceTag]
--,[Tag]
--,[DisablePortionSelection]
--,[OrderUid]
--,[Taxes]
--,[WarehouseId]
--,[DepartmentId]
--,[TerminalId]
FROM [Orders] o
CROSS APPLY OPENJSON(o.[OrderTags])
WITH (
tagName varchar(1000) '$.TN'
,tagValue varchar(1000) '$.TV'
,tagPrice varchar(1000) '$.PR'
,tagNote varchar(1000) '$.TO'
) jd
WHERE 1=1
EDIT2: Hmm strange. The first record it seems to be complaining about does not even have any data in the [OrderTags]
column (blank). If I add this constraint to the WHERE clause, no error is produced:
AND [OrderTags]!=''