Import text File having data in Json format and load into SQL server

isteyak ahmad 1 Reputation point
2021-09-07T10:20:29.04+00:00

Hi Team,

I need to created an import package in SSIS to load data from text file which is having content in json format and load into Sql server database.

Below is one sample record in text file :

{"apeId":"677ac547367456defgea42beb9bebc","apeName":"DISCOVERY STATION","id":"e1a3af5af654178a0ff5ffc01fd014a7","imageUrl":"http://172.16.6.9:8080/427/21e3698fd99ffb5c.jpg","lat":"25.038544","lng":"52.146149","monitorTask":"Traffic","resultTime":"2021-03-26 16:05:25","sceneImgUrl":"http://172.16.6.9:8080/427/21e3d99ffb5c.jpg","subType":"CAR","subjectId":"H66621","trackId":"329741647"}

I need to get only the value from this and load into sql, the key is my table column name.
Understand it can be done through script task.
Please assist me on code sample.

Thanks,
Isteyak Ahmad

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,486 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. ZoeHui-MSFT 34,581 Reputation points
    2021-09-08T02:10:59.413+00:00

    Hi @isteyak ahmad ,

    Code writing is out of my ability.

    I did some online research for you which you may take a reference to see if it is useful.

    Convert JSON to DataTable

    how-to-import-json-data-in-sql-server-using-mvc-5

    importing-json-files-using-sql-server-integration-services

    Regards,

    Zoe


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    Hot issues October

    0 comments No comments

  2. COZYROC 101 Reputation points
    2021-09-11T16:36:45.62+00:00

    T-SQL has included support for JSON data since SQL Server 2016. For further information, please check the documentation page here.

    0 comments No comments