对对象“用户",数据库"XXX",模式"dbo"的SELECT权限被拒绝 [英] The SELECT permission was denied on the object 'Users', database 'XXX', schema 'dbo'

查看:197
本文介绍了对对象“用户",数据库"XXX",模式"dbo"的SELECT权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将数据库从SQL Server 2012移到了Azure.我不想使用用户master,所以我创建了一个用户test.这是我对Azure上的数据库XXX所做的:

I moved a database from SQL Server 2012 to Azure. I don't want to use the user master, so I created a user test. This is what I did for database XXX on Azure:

create user test from login test with default_schema=[dbo]
exec sp_addrolemember 'db_owner','test'

我检查了,并且我感兴趣的数据库对象全部在模式dbo中.表Users在模式dbo中.

I checked, and the database objects I am interested in are all in the schema dbo. The table Users is in the schema dbo.

我的Web项目中的连接字符串以test作为登录名.它产生错误消息:

The connection string in my web project has test as the login. It produces the error message:

The SELECT permission was denied on the object 'Users', database 'XXX', schema 'dbo'

错误消息是什么意思,我该怎么做才能让用户test访问数据库XXX?

What does the error message mean and what can I do to let user test access the database XXX?

推荐答案

我认为问题出在具有拒绝特权的用户.当您创建的用户没有足够的权限访问数据库中的表时,将发生此错误.请勿将特权授予用户以获取所需内容.

I think the problem is with the user having deny privileges. This error comes when the user which you have created does not have the sufficient privileges to access your tables in the database. Do grant the privilege to the user in order to get what you want.

GRANT 用户对该数据库中表的特定权限,例如SELECT,INSERT,UPDATE和DELETE.

GRANT the user specific permissions such as SELECT, INSERT, UPDATE and DELETE on tables in that database.

这篇关于对对象“用户",数据库"XXX",模式"dbo"的SELECT权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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