[英]How to check quickly whether the user has write access to a particular db in sql server or not?
I have a requirement where in, I have to check whether the user has write access to a particular sql server or not. 我有一个要求,我必须检查用户是否具有对特定sql服务器的写权限。
I have done this with using Dir function for access db and other files
我通过使用
Dir function for access db and other files
来完成此Dir function for access db and other files
But SQL server, do I have to try and write a value to a table to see whether it allows me or not ? 但是,SQL Server是否必须尝试向表中写入一个值以查看它是否允许我?
You could try: fn_my_permissions . 您可以尝试: fn_my_permissions 。 The following is based on an example from the web page.
以下基于网页中的示例。
SELECT * FROM fn_my_permissions('dbo.MyTable', 'OBJECT')
ORDER BY subentity_name, permission_name ;
This will return three columns: 这将返回三列:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.