Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
runnerpaul's avatar
runnerpaul
Honored Guest
5 years ago

Saving coordinate data from Json to a Microsoft SQL Server Database table

Apoligies if I'm asking in the wrong forum.

My API receives a json file like the example below, containing x, y and z coordinates for head position and head rotation.

I
want to save this data to a table on a Microsoft SQL Server database.
Is there any advice or good practice in terms of how this kind of data
should be stored?

Currently I plan
to create a decimal column for each item. E.g I'll have hposition_x,
hposition_y, hposition_z, hrotation_x, hrotation_y and hrotation_z. Is
there a better way to do this?

I was trying to find if there's anything similar to the POINT(geography Data Type).

{
"time": [
0.0,
0.01,
0.03
],
hPosition: [
{
"x":0.43774986267089846,
"y":1.596419334411621,
"z":0.011406928300857544
},
{
"x":0.43760088086128237,
"y":1.5963757038116456,
"z":0.011429280042648316
},
{
"x":0.4374849796295166,
"y":1.5963705778121949,
"z":0.011427640914916993
}
],
hRotation: [
{
"x":357.2154541015625,
"y":272.12548828125,
"z":0.7774721384048462
},
{
"x":357.2247009277344,
"y":272.1348876953125,
"z":0.7832403182983398
},
{
"x":357.2449951171875,
"y":272.1419982910156,
"z":0.7742241621017456
}
]
}
Any help would be much appreciated.