timestamp column was not sent from Azure Stream Analytics to Azure SQL Database

Jeff Liu 91 Reputation points
2022-04-15T09:50:26.07+00:00

Hi MS support, I have encountered a problem when trying to send a timestamp column from Azure Stream Analytics (ASA) to Azure SQL Database.

According to the MS docs, I must first create a database with a table in the SQL Database and the table must have exactly the same column names and its datatype as they are in the Stream Analytics query result. (Is this understanding correct?)

I have done so but one of the columns is a Timestamp column which generates data like this "2022-04-15T04:47:05.0680000Z". The syntax that I used was this:

SELECT System.Timestamp() jobTimeStamp, ... 

Then, I created the column in the database table with the following syntax:

ALTER TABLE metricDataTable3
ADD jobTimeStamp varchar(30);

But the timestamp data was not really sent to the database table successfully. They were shown as NULL.

Can anyone help me? Urgent as my project is stuck here. Thank you very much.

Azure Stream Analytics
Azure Stream Analytics
An Azure real-time analytics service designed for mission-critical workloads.
343 questions
{count} votes

1 answer

Sort by: Most helpful
  1. HimanshuSinha-msft 19,386 Reputation points Microsoft Employee
    2022-04-18T22:00:10.24+00:00

    Hello @Jeff Liu ,
    Thanks for the question and using MS Q&A platform.

    As we understand the ask here is how to insert the timestamp in SQL , please do let us know if its not accurate.
    I did tried out this test and worked for me .

    SQL table defined

    Create table someASAtest
    (
    TimestampTest datetime
    ,transactionid int

    )

    I tried this query ( I am taking the timestamp which is key in your ask )

    select System.Timestamp() as 'TimestampTest' ,transactionid into SQLOP from EHInput

    Once the ASA job runs I am able to see the values correctly inserted in the table .

    193908-image.png

    Please do let me if you have any queries.
    Thanks
    Himanshu


    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
      • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators
    0 comments No comments