这是示例 json -
"Root Node - Type 1": {
"Attributes": {
"Items": [
{
"A": {
"Value": "A1"
},
"B": {
"Value": "B1"
},
"C": {
"Value": "C1"
},
"D": {
"Value": "D1"
}
},
{
"A": {
"Value": "A2"
},
"B": {
"Value": "B2"
},
"C": {
"Value": "C2"
},
"D": {
"Value": "D2"
}
}
]
}
}
我需要在表 1 中插入 A、B 并从表 1 中获取标识并插入表 2。此外,我需要将 C、D 插入表 3。这里的项目将是一个大数组。我希望将此数据批量插入表中。有任何想法吗?
表结构 -
CREATE TABLE [Table 1](
[Id] [int] IDENTITY(1,1) NOT NULL,
[A] [varchar](100) NULL,
[B] [varchar](15) NULL,
[CreatedBy] [varchar](255) NULL,
[CreatedDate] [datetime] NULL
CREATE TABLE [Table 2](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Table1_Id] int,
[CreatedBy] [varchar](255) NULL,
[CreatedDate] [datetime] NULL
CREATE TABLE [Table 3](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Table1_Id] [int] NOT NULL,
[Name] [nvarchar](100) NOT NULL,
[Value] [nvarchar](1000) NULL