在 Visual Studio 2010 数据库项目中编写服务器对象脚本
预部署脚本 (Script.PreDeployment.sql) 是放置创建服务器级对象(特别是我的情况下的登录)的 sql 命令的最佳位置吗?
我需要为项目中的数据库用户创建服务器登录名,这似乎是放置它们的唯一模糊逻辑位置,因为项目结构中的其他所有内容(通过反转我们的开发数据库创建)都是特定于数据库的。因此,我只想检查其他人在使用 Visual Studio 数据库项目时存储服务器级命令的位置。
非常感谢。
Is the Pre-Deployment script (Script.PreDeployment.sql) the best place to put sql commands that create server level objects (specifically logins in my case)?
I need to create server logins for the database users in the project and this seems the only vaguely logical place to put them as everything else in the project structure (created from reversing our dev db) is database specific. I therefore just wanted to check where others store their server level commands when working with Visual Studio Database Projects.
Many Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
部署数据库之前所需的任何内容都将位于该脚本中。
在我们的示例中,我们在部署后脚本中添加登录名。当我们部署数据库时不需要它们,我们决定将所有与安全相关的命令放在同一个地方。
此处是部署前和部署后参考。
Anything you need prior to deploying your database would be in that script.
In our case, we add logins in the post deployment script. They are not needed when we deploy the database, and we decided to put all the security related commands in the same place.
Here is the Pre and Post deployment reference.