Sql 2009 to jsonl ...

Carlos Arizmendi 41 Reputation points

Hi guys !!!

Does anyone know if is possible to export a table from SQL 2019 to the version name jsonl file ???

Thanks so much !!!

Kind regards.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,320 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. CathyJi-MSFT 21,116 Reputation points Microsoft Vendor

    Hi @CarlosArizmendi-1254,

    We can export data in SQL to JSON text, but not .JSONL File. JSON functions is supported from SQL 2016 to later. Format SQL Server data or the results of SQL queries as JSON by adding the FOR JSON clause to a SELECT statement.

    Please refer to MS document Convert SQL Server data to JSON or export JSON or the blog to get more details.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    1 person found this answer helpful.
    0 comments No comments

  2. Carlos Arizmendi 41 Reputation points

    Thanks so much !!!

    So the only way is to export in a format like JSON or CSV and after transform it to JSONL.

    I'm right ???

    Thanks so much !!!

  3. Yitzhak Khabinsky 24,726 Reputation points

    Hi @Carlos Arizmendi ,

    It is easy to achieve by using a so called SQLCMD mode in SSMS.

    Check it out.


    -- To change to SQLCMD Mode - select Query from the menu and then select SQLCMD Mode.  
    -- file will be generated on the machine where SSMS is running !!!  
    :out E:\Temp\currencyCodes.json  
    SELECT *  
    FROM [AdventureWorks].[Sales].[Currency]  
    0 comments No comments