sql-server - 是否可以将 sql clr 函数重写为 sql 存储过程?
问题描述
我在我的项目中使用带有 sql clr 用户定义函数的 sql clr 程序集。例如:
[SqlFunction]
public static SqlString InsertCampaignRecipients(SqlString url)
{
var rowData = string.Empty;
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
var response = client.GetAsync(new Uri(url.Value)).Result;
if (response.IsSuccessStatusCode)
{
var result = response.Content.ReadAsStringAsync().Result;
if (result.IndexOf(@"""Exception"":null}") > 0) //success
{
rowData = "success";
}
else
{
rowData = string.Empty;
}
}
else
{
rowData = string.Empty;
}
}
return rowData;
}
但我想在 clr 不支持的 Azure 上迁移。解决办法是什么?是否可以将 sql clr 函数重写为 sql 存储过程之类的?
解决方案
所以你想直接从 T-SQL 发出一个 HTTP 请求。那是不能做的,对不起!
推荐阅读
- android - 变音符号渲染不正确
- git - 如何在 github 中删除提交
- matlab - Matlab:遍历矩阵行以计算最小值
- redirect - 自 VC++ 2015 / 14.0 以来,将 stderr 重定向到网络驱动程序上的文件非常慢
- android - 如何滚动通知中的文本?
- javascript - 如果使用 JavaScript/jQuery 的 FTP 上不存在该文件,有没有办法隐藏链接?
- reactjs - 将父道具异步更新到子组件
- swagger - Swagger 响应关联对象
- git - 如何使用 git 在两个文件之间创建 interdiff?
- firebase - Flutter:GeoFire 库搜索 queryAtLocation 不起作用