CLR 存储过程:如何设置架构/所有者? [英] CLR Stored Procedures: how to set the schema/owner?

查看:39
本文介绍了CLR 存储过程:如何设置架构/所有者?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究基于 Linq 的 CLR 存储过程,以进行一些复杂的过滤和操作,否则,如果在更传统"的存储过程中实现,则需要大量杂乱且性能低下的 T-SQL 代码.

I am working on a Linq based CLR Stored Procedure for some complex filtering and manipulation, which would otherwise require a lot of messy and poorly performant T-SQL code, if implemented in a more "traditional" Stored Procedure.

这很好用,但我找不到如何在部署阶段设置此存储过程的架构,以便更好地组织和分离模块中的数据库对象.

This is working great, but I can't find how to set the schema of this Stored Procedure in phase of deployment, for a better organization and separation of the database objects in modules.

有什么想法吗?

非常感谢.

推荐答案

当您创建引用程序集的过程时,您可以创建由您想要的任何架构拥有的此包装器.请参阅这篇关于部署 CLR 存储过程的 MSDN 文章有关如何部署存储过程的演练.通过将 create procedure 语句更改为类似:

When you create the procedure referencing the assembly you can create this wrapper being owned by any schema you want. See This MSDN article on deploying CLR stored procedures for a walkthrough of how to do deploy a stored procedure. By changing the create procedure statement to something like:

CREATE SCHEMA foo

CREATE PROCEDURE foo.hello
AS
EXTERNAL NAME helloworld.HelloWorldProc.HelloWorld

您现在可以拥有 foo 架构拥有的过程.

You can now have a procedure owned by the foo schema.

这篇关于CLR 存储过程:如何设置架构/所有者?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆