SQL Server CLR 函数
在编写 CLR 函数 Sql Server 时,我们可以使用命名空间吗?
namespace SomeName1.SomeName2
{
public static class SomeClass
{
[SqlFunction]
public static SqlString SomeMethod(SqlString input)
{
// ....
}
}
}
如果是这样,那么我们如何从SqlServer调用这个函数。换句话说,我们如何使用命名空间从 SQL Server 调用 CLR 函数?
While writing a CLR function Sql Server can we use namespaces ?
namespace SomeName1.SomeName2
{
public static class SomeClass
{
[SqlFunction]
public static SqlString SomeMethod(SqlString input)
{
// ....
}
}
}
If so, then how do we call this function from SqlServer. In other words how do we call CLR functions from SQL Server with namespaces?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,您绝对可以:
其中第一部分中的
[SomeName1.SomeName2]
是 SQL Server 中命名的程序集,其余部分 ([SomeName1.SomeName2.SomeClass.SomeMethod]
code>) 是完全限定的函数名称,包括命名空间。顺便说一句,如果您从 Visual Studio 进行部署,它会为您处理很多事情。
Yes, you absolutely can:
Where
[SomeName1.SomeName2]
in the first part is the assembly as named in SQL Server, and the rest ([SomeName1.SomeName2.SomeClass.SomeMethod]
) is the fully qualified function name, including the namespace.Incidentally, if you deploy from Visual Studio it handles a lot of this for you.