Execute stored procedure from Azure datafactory

后端 未结 2 756
被撕碎了的回忆
被撕碎了的回忆 2021-01-16 00:17

I am trying to execute a stored procedure in an Azure SQL database from an Azure DataFactory V2. The procedure will do some upsert into different tables with data from a fla

2条回答
  •  一个人的身影
    2021-01-16 00:25

    I'm not sure if I understand the problem correctly, you just want to call a stored procedure from a copy activity?

    Doing that is pretty easy, in a copy activity you can define the sqlReaderQuery property inside source. This property lets you enter a t-sql command, so you can do something like this:

     "typeProperties": {
            "source": {
                "type": "SqlSource",
                "sqlReaderQuery": "EXEC sp_Name; select 1 as test"
            },
     . . .
    

    Copy activity always expects a result from the query, so if you only include the call to the stored procedure it doesnt thats why I include the second part of the query.

    Replace with the parameters you want to use and thats it.

提交回复
热议问题