Calling an API from SQL Server stored procedure

后端 未结 7 526
暖寄归人
暖寄归人 2020-11-28 04:23

Calling an API from ASP.NET Web Form is very easy.

WebClient wc = new WebClient();
string urlData = wc.DownloadString(\"http://xxx.xxx.xx.xx/sssss/getRespons         


        
7条回答
  •  南笙
    南笙 (楼主)
    2020-11-28 05:04

    Screams in to the void - just "no" don't do it. This is a dumb idea.

    Integrating with external data sources is what SSIS is for, or write a dot net application/service which queries the box and makes the API calls.

    Writing CLR code to enable a SQL process to call web-services is the sort of thing that can bring a SQL box to its knees if done badly - imagine putting the the CLR function in a view somewhere - later someone else comes along not knowing what you've donem and joins on that view with a million row table - suddenly your SQL box is making a million individual webapi calls.

    The whole idea is insane.

    This doing sort of thing is the reason that enterprise DBAs dont' trust developers.

    CLR is the kind of great power, which brings great responsibility, and the above is an abuse of it.

提交回复
热议问题