问题
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