[英]Microsoft SSDT (10.3.21208.0)/Data-tier Project (MSVS 2010) and “Sharing”/Copied Certificates between the Project and Referenced Database Project
I am writing a "framework" of SQL Server (targeting 2008R2 and 2012) stored procedures and common/reference tables. 我正在编写SQL Server(面向2008R2和2012)存储过程和公共/引用表的“框架”。 Each SSDT/Date-tier project represents a different component (can be within the same database) within this framework (eg, MasterDBExtensions project has stored procedure extensions/add ons within the Master Database, SQLServerAgentExtensions (msdb), etc).
每个SSDT / Date层项目在此框架内表示一个不同的组件(可以在同一数据库中)(例如,MasterDBExtensions项目已在Master数据库,SQLServerAgentExtensions(msdb)等内部存储了过程扩展/附加组件)。
I developed a farily strict security model heavily based on Schema, database roles, and certificates. 我在很大程度上基于模式,数据库角色和证书开发了严格严格的安全模型。
My issue is how do I "share"/copied these certificates between the active project and the referenced projects so that when I publish the active project to SQL Server the certificates are properly copied, etc. (btw I need to share/copy the certificates for cross-database object access so that I do not need to turn the Trustworthy flag on, Service Broker, and also for linked server access). 我的问题是如何在活动项目和引用的项目之间“共享” /复制这些证书,以便在将活动项目发布到SQL Server时正确复制证书等。(顺便说一句,我需要共享/复制证书(用于跨数据库对象访问),这样我就不需要在Service Broker上打开Trustworthy标志,也不需要在链接服务器上访问)。
Just for clarification I have some TSQL Code that represents what I mean: 为了澄清起见,我有一些TSQL代码代表我的意思:
use [DatabaseA]
Create Certificate [MyCertFromA] ...
Backup Certificate [MyCertFromA] to File = 'MyCertFromA.cert'
use [DatabaseB]
Create Certificate [MyCertFromA] from File = 'MyCertFromA.cert'
SSDT/Data-tier will NOT allow me to place the Backup and Create/From statement (I get the "This statement is not recognized in this context"). SSDT /数据层不允许我放置Backup and Create / From语句(我得到“在这种情况下无法识别此语句”)。 If I move the Backup Certificate to a Pre/Post Script I run into issues with file permisions and other issues (eg, Certificate NOT found).
如果我将备份证书移至前/后脚本,则会遇到文件迁移和其他问题(例如,找不到证书)。 Besides the Pre/Post scripts do not run if I use the project as a database reference in other projects.
此外,如果我将该项目用作其他项目中的数据库引用,则前/后脚本不会运行。
So... What am I doing wrong or does anyone have any suggests around these issues? 那么... 我在做错什么,还是有人对这些问题有任何建议?
Thanks! 谢谢!
Enviroment: SQL Server 2012 (I also target SQL Server 2008R2), MSVS 2010, SqlServer Data Tools Dec. 2012, SQL Sever Data-Tier Application Framework May 2013, C# 4.0 环境:SQL Server 2012(我也针对SQL Server 2008R2),MSVS 2010,SqlServer数据工具2012年12月,SQL Server数据层应用程序框架2013年5月,C#4.0
Looks like this has been answered somewhat by CTP4 Certficate issue - sometimes server, sometimes database scoped 看起来CTP4证书问题已部分解决了此问题-有时是服务器,有时是数据库范围的
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.