0
我們正處於一個表(MS SQL Azure的)與具有實體的基本細節,如下面幾列:移動JSON最多的層次
CREATE TABLE [dbo].[Person]
(
id [uniqueidentifier] NOT NULL,
[firstname] [varchar](50) NULL,
[lastname] [varchar](50) NOT NULL,
[personInfo] [nvarchar](max) NOT NULL,
[createdOn] [datetime] NOT NULL,
[lastUpdateOn] [datetime] NOT NULL,
)
的PersonInfo領域具有的所有的JSON值大約如下所示的一個人的附加細節:
{
"personInfo" : {
"gender" : "string",
"address" : {
"streetAddress" : "string",
"city" : "string",
"district" : "string",
"stateProvince" : "string",
"postalCode" : "string",
"country" : "string",
},
"emailAddress" : "string",
"addlEmails" : [{
"type" : "string",
"address" : "string"
}
],
"businessPhone" : "string",
"mobilePhone" : "string",
"addlPhones" : [{
"type" : "string",
"number" : "string",
"prefix" : "string",
"suffix" : "string"
}
]
}
}
我有一個要求獲取數據了從SQL與個人信息一個JSON的水平屬性上升。像如下:
{
"id" : "string",
"firstname" : "string",
"lastname" : "string",
"id" : "string",
"gender" : "string",
"address" : {
"streetAddress" : "string",
"city" : "string",
"district" : "string",
"stateProvince" : "string",
"postalCode" : "string",
"country" : "string",
},
"emailAddress" : "string",
"addlEmails" : [{
"type" : "string",
"address" : "string"
}
],
"businessPhone" : "string",
"mobilePhone" : "string",
"addlPhones" : [{
"type" : "string",
"number" : "string",
"prefix" : "string",
"suffix" : "string"
}
]
}
有反正我可以做到這一點嗎?
問候, 約翰