生成发布脚本时出错:对象 __refactorlog 的选择权限被拒绝? [英] Error generating publish script: the select permission was denied on the object __refactorlog?

查看:26
本文介绍了生成发布脚本时出错:对象 __refactorlog 的选择权限被拒绝?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 SSDT 项目中,为什么会出现此错误?

In my SSDT Project, why could I be getting this error?

对象 __refactorlog 的选择权限被拒绝?"

"the select permission was denied on the object __refactorlog?"

项目中有一个重构日志项.

There is a refactorlog item in the Project.

我选择从 VS 内部生成发布脚本.

I select to generate a publish script from inside VS.

目标是生产服务器,所以我没有在那里创建表或选择数据的权限,我只需要创建部署脚本,无论如何都没有表 __refactorlog..

the target is a production server, so I don't have permissions to create tables or select data there, I just have to create the deployment script, and there is no table __refactorlog anyway..

推荐答案

您需要比当前在该服务器上拥有的权限更高的权限才能生成发布脚本.我验证了在检查表是否存在的代码处理重构操作中存在调用SELECT OBJECT_ID(N'dbo.__RefactorLog')".代码很可能在那个时候失败了,因为您甚至没有权限要求选择对象.您可以通过对数据库运行该查询并查看是否出现错误来自行检查这一点.

You need greater permissions than you currently have on that server in order to generate a publish script. I verified that there is a call "SELECT OBJECT_ID(N'dbo.__RefactorLog')" in the code handling refactor operations that checks if the table exists. It's likely that the code is failing at that point as you don't have the permissions to even ask to select the object. You can check this yourself by running that query against the database and seeing if you get an error.

确定所需权限的建议:

  • 尝试右键单击数据库并选择创建新项目".如果您无法将数据库定义提取到项目中,则表明您没有数据库的查看定义权限
  • 如果情况并非如此,则问题在于您需要对 __refactorlog 表的读取权限,而没有它.解决方案是访问该表,否则您必须验证不需要任何重构并从项目中删除重构日志(不推荐,因为通常您希望保留重构以避免可能的数据丢失和其他问题).

这篇关于生成发布脚本时出错:对象 __refactorlog 的选择权限被拒绝?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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