How can I set Stream Analytics Output as Stored Procedure

寵の児 提交于 2020-02-08 02:31:31

问题


How can I add Stored Procedure as Analytics Output More simply how can I send my analytics result to sp parameter


回答1:


how can I send my analytics result to sp parameter

If you’d like to pass Stream Analytics jobs result to a Stored Procedure in SQL Database, it seems that there are no direct way to pass analytics result to Stored Procedure and execute the Stored Procedure.

Stream Analytics jobs could write result to an existing table in an Azure SQL Database, you could try to create a Trigger and query result from table and execute Stored Procedure with analytics result, which might be a possible solution.

CREATE TRIGGER mytesttrigger  
ON [dbo].[TableName]
AFTER INSERT   
AS  
   --query the result 

   --execute SP

   EXEC [dbo].[SP name] @para1 = 'val1', @para2 = 'val2';
GO



回答2:


You can work with an Azure Function that is triggered by the Azure Stream Analytics Job (HTTP Trigger). The Azure Function then calls the Stored Procedure and passes the ASA output as payload.



来源:https://stackoverflow.com/questions/44026676/how-can-i-set-stream-analytics-output-as-stored-procedure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!