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

isteyak ahmad 1 Reputation point

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":"","lat":"25.038544","lng":"52.146149","monitorTask":"Traffic","resultTime":"2021-03-26 16:05:25","sceneImgUrl":"","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.

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

    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





    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

    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