Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Parse Json structure using SSIS and load into table in sql server

Posted on 2013-06-04
2
Medium Priority
?
2,164 Views
Last Modified: 2016-02-11
I have a table with a column which has data in JSON format

Example:
{"id":0,"name":null,"type":"Address","value":"\"02421\"","count":0}

I need to parse this and store the values in different columns in sql server using SSIS.

Can you please give some suggestions for parsing json structure using SSIS
0
Comment
Question by:MRPT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Accepted Solution

by:
DcpKing earned 1500 total points
ID: 39221015
How do you parse it yourself?
Well, you start at a { and end at a }
Inside that there's a number of name-value pairs - here there are
          "id":0,"name":null,"type":"Address","value":"\"02421\"","count":0
which come out as
          "id":0,
          "name":null,
          "type":"Address",
          "value":"\"02421\"",
          "count":0
So you see that each data element (name-value pair) has a name (withing quotes), a colon, the value, and a comma (or the finishing brace). A value can be just what it is, or a string in quotes, and you'll have to cope with the escaped internal quote, but that won't be too hard.

I'd suggest that you write code to fill a table of three columns (first being an identity col to retain the sequence) and then fill your storage table.

hth

Mike
0
 

Author Closing Comment

by:MRPT
ID: 39285344
Thank You
0

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how the fundamental information of how to create a table.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question