SQL Server 禁用所有触发器 - 找不到对象“XXXX”因为它不存在或您没有权限
我正在尝试在 SQL Server 中运行此命令:
disable trigger all on MYDB
这对我来说失败了。我登录的帐户可以访问 MYDB,并且我几乎已经授予了它所有可用的权限(它只是本地数据库和我的帐户,所以这没问题)。我不明白为什么它告诉我找不到 MYDB?我以前做过这个。另请注意:我可以从数据库中进行选择、更新并运行授予语句(例如授予过程的执行)。我也可以手动禁用触发器...
那么为什么会失败呢?我以前能做到...
谢谢。
I'm trying to run this command in SQL Server:
disable trigger all on MYDB
This is failing for me. The account I'm logged into has access to MYDB and I've pretty much giving it every single permission available (it's a local DB and my account only, so this is OK). I don't understand why it's telling me it can't find MYDB for this? I've done this before. Also note: I can select from the database, update, and run a grant statement (such as granting execution of a proc). I can also disable triggers manually...
So why does this fail? I was able to do it before...
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
要启用所有触发器,您可以使用以下语句
To enable all triggers, you can use following statement
对于 SQL 服务器:
For sql server:
不知道为什么 Yuck 删除了他们的答案。来自禁用触发器:
也就是说,您不能为此语句提供数据库名称。虽然
MYDB
数据库存在,但其中不有一个名为MYDB
的对象。Not sure why Yuck deleted their answer. From DISABLE TRIGGER:
That is, you can't provide a database name to this statement. Whilst the
MYDB
database exists, there isn't an object within it calledMYDB
.