IRobot
1
So I have a property that is serialized:
{
"name": 'Peter P.',
"settings": "{\"LifePoints\": 166.0, \"DefaultPower\": null, \"DefaultConfiguration\": \"{\\\"DefaultPowers\\\":[], \\\"Strength\\\": 8}\" }",
"type": "hero"
}
The result should be the row:
Peter P., 8
My current is similar to this:
SELECT
name,
DESERIALIZE_METHOD(settings).DefaultConfiguration.Strength
vsr1
2
@IRobot ,
Use DECODE_JSON()
Based on your input. (settings is encode json string with in that DefaultConfiguration again encoded json string)
SELECT d.name, DECODE_JSON(DECODE_JSON(d.settings).DefaultConfiguration).Strength
FROM [ { "name": 'Peter P.', "settings": "{\"LifePoints\": 166.0, \"DefaultPower\": null, \"DefaultConfiguration\": \"{\\\"DefaultPowers\\\":[], \\\"Strength\\\": 8}\" }", "type": "hero" }] AS d;