在自定义操作中删除数据库 [英] Drop database in custom action

查看:65
本文介绍了在自定义操作中删除数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试创建一个自定义操作,在卸载过程中将删除数据库。一个要求是应该使用可信安全性来完成。当我然后运行卸载时,我遇到一个问题,即进程更改用户并尝试执行sql
命令作为NT instance\SYSTEM用户,该用户无权删除数据库。我调用一个sql过程来清理数据库服务器,包括。从自定义操作中删除数据库。如何在自定义操作中调用调用sql过程的调用
运行卸载过程的用户?



我正在处理数据库项目,包含解决方案中的许多数据库。我正在寻找的是为整个解决方案安装msi。安装时,我可以作为管理员运行,它的工作很好,但我没有设法
以管理员身份运行卸载,导致错误(无权删除数据库)。由于我们需要使用集成安全性,卸载的用户必须拥有数据库的权限,但卸载程序似乎以系统用户身份运行。



所以,我想在自定义操作中创建一个卸载方法,该操作向用户提供"run as administartor"。然后管理员用户可以连接到数据库服务器并删除数据库。

解决方案

Hi Anders.K,


<感谢您在MSDN论坛上发帖。


此论坛是关于VS设置和安装的,因为您的问题与卸载项目有很大关系,我帮您将此案例移至ClickOnce论坛为了获得更多的专业支持。


感谢您的理解与合作。


最诚挚的问候,

I try to create a custom action that in the uninstall procedure will drop a database. One requirement is that this should be done with trusted security. When I then run uninstall, I get a problem that the process changes users and try to execute the sql command as NT instance\SYSTEM user, which is not authorized to drop the database. I call a sql procedure to clean the database server, incl. Drop databases, from the custom action. How can I get the call in the custom action to call the sql procedure with the user who runs the uninstall process?

I'm working on a database project that contains a number of databases in the solution. What I'm looking for is to do an installation msi for the whole solution. While installing, I can run as an administrator and its work just fine, but I have not managed to run the uninstall as an administrator and that result in an ERROR (no rights to drop database). Because we are required to use integrated security, the user who uninstalls has to have rights in the database, but the uninstaller seems to run as a system user.

So, I want to create a uninstall method in a custom action that promt the user for "run as administartor". And then can the administrator user connect to the database server and dropp the databases.

解决方案

Hi Anders.K,

Thank you for posting in MSDN forum.

This forum is about VS setup and installation, as your question is much related to a uninstall project, I help you move this case to ClickOnce forum for a much professional support.

Thank you for your understanding and cooperation.

Best Regards,


这篇关于在自定义操作中删除数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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