Visual Studio SSDT 项目中的多个 CLR 架构
我尝试在 Visual Studio 2022 中创建一个 sqlproj 项目,代表我的 SQL Server 数据库。
在 C# 中创建 CLR 存储过程或函数时,SqlFunction
或 SqlProcedure
属性具有 Name
属性,但没有架构。看来整个项目都会使用默认模式。我希望能够拥有多个包含 CLR 项的架构。
我发现了几种不同的方法可以在部署后将过程从一个模式移动到另一个模式,但是有没有什么方法可以一开始就把它做好呢?
例如,默认情况下,如果我创建一个 MyProc
过程,我可以从常规过程将其引用为 dbo.MyProc
。但我希望它存在于 other
模式中。即使我将架构更改为部署后步骤,我使用 EXEC [other].[MyProc]
的常规过程也不会在 Visual Studio 中正确编译,因为它认为它引用了一个不存在的过程。
我不需要多个项目,因为我想要整个数据库的功能齐全的模式比较和发布步骤。
I'm trying to have a single sqlproj
project in Visual Studio 2022, representing my SQL Server database.
When creating a CLR stored proc or function in C#, the SqlFunction
or SqlProcedure
attribute has a Name
property, but not a schema. It seems the entire project will use the default schema. I'd like to be able to have more than one schema with CLR items.
I've found a couple different ways of moving procs from one schema to another after deployment, but is there any way to get it right in the first place?
For example, by default, if I create a MyProc
procedure, I can reference it as dbo.MyProc
from a regular proc. But I want that to live in the other
schema. Even if I change schemas as a post-deploy step, then my regular procs with EXEC [other].[MyProc]
will not compile properly in Visual Studio since it thinks it's referencing a non-existent procedure.
I don't want multiple projects because I want fully-functional schema compare and publish steps for the whole database.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论