Solved

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

Posted on 2013-06-04
2
2,081 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 500 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

I have a large data set and a SSIS package. How can I load this file in multi threading?
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

752 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