SQL Server SMO 是否需要特殊权限才能使用?

发布于 2024-07-21 16:47:29 字数 205 浏览 5 评论 0原文

我有 SMO 代码,可将表从一个数据库复制到另一个数据库。 它在桌面应用程序中运行良好。 放入服务中的相同代码会给出错误。 该错误确实很晦涩,并且没有暗示权限。

我想知道 SMO 对象是否需要任何类型的安全性才能使用。 安全环境? Windows 凭据..等等? 我不是在谈论 SQL Server 安全性,而是在谈论 SMO 方法的使用周围的安全性。

I have SMO code which copies tables from one database to another. It runs fine in a desktop app. The same exact code put in a service, gives an error. The error is really obscure and doesn't hint about permissions.

I was wondering if the SMO objects need any kind of security to be used. Security context? Windows credentials.. etc? I am not talking about SQL Server security but security surrounding the use of the SMO methods.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

揽清风入怀 2024-07-28 16:47:29

你需要充分的信任。 您可能会在某些托管 ASP.NET 帐户、从互联网下载的应用程序或从共享驱动器上运行此程序时遇到问题,其中 CAS 会启动并给予代码不完全信任的内容,并且某些 API 将无法调用。

You need full trust. You may have problems running this on certain hosted ASP.NET accounts, apps downloaded from the internet, or from shared drives, where CAS kicks in and gives the code something less than full trust and certain APIs won't be callable.

王权女流氓 2024-07-28 16:47:29

您的连接是否使用集成安全性? 如果是这样,请确保运行该服务的凭据具有必要的访问权限。

Are you using integrated security with your connection? If so, make sure the credentials that the service is running under have necessary access.

热风软妹 2024-07-28 16:47:29

确保您的服务帐户(运行 Windows 服务的帐户)具有“充当操作系统的一部分”策略。

Make sure your service account (the account that your windows service is running as) has "Act as Part of Operating System" Policy.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文