I want to insert below data into a SQL Server table
{
"ITEM_NUMBER":"CSC-ENVM",
"SHIPPED_DATE":"1995-08-22T00:00:00",
"STATUS":"Shipped",
"SOURCE":"Shipment"
},
{
"ITEM_NUMBER":"NP-2R",
"SHIPPED_DATE":"1995-03-14T18:23:00",
"STATUS":"Shipped",
"SOURCE":"Shipment"
}
NP-2R |1995-03-14T18:23:00|Shipped |Shipment**
Just insert into table of a column with Varchar column as mentioned in comments as well
insert into #temp
select '{
"ITEM_NUMBER":"CSC-ENVM",
"SHIPPED_DATE":"1995-08-22T00:00:00",
"STATUS":"Shipped",
"SOURCE":"Shipment"
},
{
"ITEM_NUMBER":"NP-2R",
"SHIPPED_DATE":"1995-03-14T18:23:00",
"STATUS":"Shipped",
"SOURCE":"Shipment"
}'
In SQL 2008,you also can read this JSON data using ParseJson function created by Phil Factor.you can read on about that here...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.