Thanks! The soultion we found is converting into XML first –
SELECT
JSON_QUERY('[' + STUFF(( SELECT ',' + '"' + item_id + '"'
FROM #temp FOR XML PATH('')),1,1,'') + ']' ) ids
FOR JSON PATH , WITHOUT_ARRAY_WRAPPER
More Related Contents:
- How do I query using fields inside the new PostgreSQL JSON datatype?
- Index for finding an element in a JSON array
- Query for array elements inside JSON type
- How can I import a JSON file into PostgreSQL?
- Is there a LastIndexOf in SQL Server?
- Return multiple columns of the same row as JSON array of objects
- SQL Server SELECT to JSON function
- When can I save JSON or XML data in an SQL Table
- Query for element of array in JSON column
- Generate nested nth level JSON SQL Server using recursive CTE
- Query json dictionary data in SQL
- PostgreSQL Index on JSON
- How to search SQL column containing JSON array
- Operator does not exist: json = json
- How can I work with SQL NULL values and JSON in a good way?
- Current date in Oracle Db
- How do I UPDATE from a SELECT in SQL Server?
- Optimize GROUP BY query to retrieve latest row per user
- INNER JOIN vs LEFT JOIN performance in SQL Server
- Function vs. Stored Procedure in SQL Server
- Check if value exists in Postgres array
- Finding duplicate rows in SQL Server
- Is there common street addresses database design for all addresses of the world? [closed]
- How to use ASP variables in SQL statement
- Split values over multiple rows [duplicate]
- SQL Server: should I use information_schema tables over sys tables?
- SQL Server Cumulative Sum by Group
- How to handle optional parameters in SQL query?
- SQL Server SELECT INTO @variable?
- Select a column if other column is null