找不到用户 '',因为它不存在或您没有权限 [英] Cannot find the user '', because it does not exist or you do not have permission

查看:35
本文介绍了找不到用户 '',因为它不存在或您没有权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为使用此查询的用户添加对存储过程的权限,

I am trying to add permissions to a Store procedure for a user using this query,

USE [MyDatabaseName]
GO

GRANT EXEC ON [dbo].[StoreProcedureName] TO [UserName]
GO

我可以通过用户界面向用户授予权限但是使用这个查询我得到这个错误,

I can give permissions to user through theUser Interface but using this query I get this error,

找不到用户用户名",因为它不存在或您没有许可.

Cannot find the user 'UserName', because it does not exist or you do not have permission.

如果我没有权限,那么如何使用用户界面添加权限.

If I don't have permissions then how can I add permissions using User Interface.

推荐答案

我刚遇到同样的问题.

确保在主表中有您登录的用户映射.不需要数据库角色成员资格,只需在登录用户名"的属性中的用户映射"下为数据库主打勾映射"即可.

Make sure there is an user mapping for your login in the master table. No database role memberships are required, just tick 'Map' for the database master under 'User Mapping' in the properties for the login 'UserName'.

这篇关于找不到用户 '',因为它不存在或您没有权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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