简体   繁体   English

Microsoft SSDT(10.3.21208.0)/数据层项目(MSVS 2010)和项目与引用的数据库项目之间的“共享” /复制的证书

[英]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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何更新我的数据层应用程序项目以反映在其他工具中进行的架构更改? - How do I update my Data-Tier Application project to reflect schema changes made in other tools? NuGet包未从引用的项目中复制 - NuGet packages not copied from referenced project 使用SSDT的数据项目,如何引用另一个数据库而不将其填充到SS Obj Explorer中的同一项目文件夹中 - Data Project using SSDT, how to reference another database without it populating in same project folder in SS Obj Explorer 数据库项目,与SSDT和TFS的无基础合并 - Database Project, Baseless Merge with SSDT & TFS 是否可以从数据库更新SSDT DB项目? - Is it possible to update a SSDT DB project from a database? Visual Studio 2010数据库项目数据 - Visual studio 2010 database project data 引用项目的必要文件未复制到发布文件夹 - Referenced project's necessary files not copied to the release folder Visual Studio SSDT 数据库项目在重新启动时不会显示架构节点 - Visual Studio SSDT Database project will not display schema node on restart SSDT SQL 服务器数据库项目 sql 文件中缺少工具栏 - Missing toolbar in SSDT SQL Server Database Project sql file 此项目不支持的VB版本(SSDT) - Unsupported VB Version for this Project (SSDT)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM