none
Usql query

    Question

  • I want to store data through Usql only.
    Below is a Usql query I have written in Azure Data Lake Analytics for fetching data from data.csv (Which is stored in Azure Data Lake) and again saving the data received to a new file newdata.csv (Which is again stored in Azure Data Lake) .
    @a  = EXTRACT customer string  FROM "/data.csv"
     USING Extractors.Csv();
    OUTPUT @a
        TO "/newdata.csv"
        USING Outputters.Csv();
    But now I want to write a Usql Query in  Azure Data Lake Analytics for fetching data from data.csv (Which is stored in Azure Data Lake) and this time output is Azure SQL DB table.
    So I am not getting how to write the U sql query for it.
    Could you please write it down and let me know.

    AM

    Monday, August 7, 2017 3:15 AM

All replies

  • Hi, writing to Azure SQL DB using U-SQL is not possible, you can only read from SQL. You could use Azure Data Factory for this task.

    For an overview of the U-SQL read/write possibilities see: http://www.jamesserra.com/archive/2017/03/u-sql-defined/usql/


    Jorg Klein's Microsoft Business Intelligence Blog

    Monday, August 7, 2017 7:01 AM
  • with U-SQL you can't do it.

    with U-SQL you can read the data from data lake and process it in a separate library by creating a new copy of that file.

    But to achieve this, like take data and modified copy data you can save it in Azure data lake store and then you can Go for PowerShell / ADLS SDK  to move that file to anywhere you want.

    You can refer this for more information: https://stackoverflow.com/questions/40243780/how-to-move-processed-file-to-another-directory-using-u-sql

    Mahi


    Please Mark as answer if found useful :)

    Monday, August 7, 2017 10:03 AM