I have a table like below in my SQL server database. I want to parse the numbers from "objectId": and save it as multiple rows. Is this possible? Please help to do it in SQL.

I dont know how to achieve this in SQL.
| ID | Key | Services |
|---|---|---|
| 14005 | ABC-472 | [{"workspaceId": "xxxxxxxxxxxxxxxxxxxxxxxxx", "id": "xxxxxxxxxxxxxxxxxxxxxxxxx:32583","objectId": "32583"},{"workspaceId": "xxxxxxxxxxxxxxxxxxxxxxxxx","id": "xxxxxxxxxxxxxxxxxxxxxxxxx:8965","objectId": "8965"}] |
>Solution :
Try this:
DROP TABLE IF EXISTS #tempTable;
CREATE TABLE #tempTable (
ID int,
[Key] varchar(25),
Services varchar(max)
);
INSERT INTO #tempTable (ID, [Key], Services)
VALUES (14005, 'ABC-472', '[{"workspaceId": "xxxxxxxxxxxxxxxxxxxxxxxxx", "id": "xxxxxxxxxxxxxxxxxxxxxxxxx:32583", "objectId": "32583"}, {"workspaceId": "xxxxxxxxxxxxxxxxxxxxxxxxx", "id": "xxxxxxxxxxxxxxxxxxxxxxxxx:8965", "objectId": "8965"}]');
SELECT *
FROM #tempTable;
SELECT ID, [Key], workspaceId, requestId, objectId
FROM #tempTable
CROSS APPLY OPENJSON(Services)
WITH
(
workspaceId varchar(50) '$.workspaceId',
requestId varchar(50) '$.id',
objectId varchar(50) '$.objectId'
) as ServicesJson;