获取sybase存储过程的权限

发布于 2024-10-04 12:23:36 字数 28 浏览 0 评论 0原文

如何获得sybase中存储过程的授予权限?

How do I get the granted permissions for a stored procedure in sybase?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一念一轮回 2024-10-11 12:23:36

这取决于您想要该信息的形式。

  • 如果您出于某种内部目的而编写 SQL,并且需要该信息作为其数据,那么 Kolchanov 的答案是正确的。
  • 如果您只是执行 DBA 功能,那么任意数量的 DBA GUI 工具(SybaseCentral 随 CD 一起提供;DBArtisan 更好)通过资源管理器窗口提供该信息并单击
    • 如果您只有基于字符的访问权限,请使用
      sp_helprotect proc_name

Sybase 在线手册链接

然后转至:Adaptive Server Enterprise 15.5/参考手册:过程,然后按照浏览器操作。

It depends on the form that you want that info in.

  • If you are writing SQL for some internal purpose, and you need that info as data for it, Kolchanov's answer is correct.
  • If you are merely performing DBA functions, then any number of DBA GUI tools (SybaseCentral comes with the CD; DBArtisan is much better) provide that info via an explorer window and clicks
    • If you only have character based access, use
      sp_helprotect proc_name

Link to Sybase Online Manuals

Then go to: Adaptive Server Enterprise 15.5/Reference Manual: Procedures, nd follow the explorer.

三寸金莲 2024-10-11 12:23:36

如果我想检查对象“whatever_[table|procedure]”的权限,我将运行以下查询:

“whatever”是表的示例

Displaying result for:
---------------------
select permission = a.name
from master.dbo.spt_values a
   , master.dbo.spt_values b
   , sysprotects p
   , sysobjects  o
where a.type = "T"
and   a.number = p.action
and   b.type = "T"
and   b.number = (p.protecttype + 204)
and   o.id = p.id
and   o.name = 'whatever_table'

permission                   
---------------------------- 
References                   
Select                       
Insert                       
Delete                       
Update                       

5 Row(s) affected

“whatever”是存储过程的示例

Displaying result for:
---------------------
select permission = a.name
from master.dbo.spt_values a
   , master.dbo.spt_values b
   , sysprotects p
   , sysobjects  o
where a.type = "T"
and   a.number = p.action
and   b.type = "T"
and   b.number = (p.protecttype + 204)
and   o.id = p.id
and   o.name = 'whatever_procedure'

permission                   
---------------------------- 
Execute                      

1 Row(s) affected

If I wanted to check the permissions for object "whatever_[table|procedure]", I would run the following query:

Example for "whatever" being a table

Displaying result for:
---------------------
select permission = a.name
from master.dbo.spt_values a
   , master.dbo.spt_values b
   , sysprotects p
   , sysobjects  o
where a.type = "T"
and   a.number = p.action
and   b.type = "T"
and   b.number = (p.protecttype + 204)
and   o.id = p.id
and   o.name = 'whatever_table'

permission                   
---------------------------- 
References                   
Select                       
Insert                       
Delete                       
Update                       

5 Row(s) affected

Example for "whatever" being a stored procedure

Displaying result for:
---------------------
select permission = a.name
from master.dbo.spt_values a
   , master.dbo.spt_values b
   , sysprotects p
   , sysobjects  o
where a.type = "T"
and   a.number = p.action
and   b.type = "T"
and   b.number = (p.protecttype + 204)
and   o.id = p.id
and   o.name = 'whatever_procedure'

permission                   
---------------------------- 
Execute                      

1 Row(s) affected
南巷近海 2024-10-11 12:23:36

Adaptive Server Enterprise 15.5 >参考手册:表格>系统表

sysprotects

sysprotects 包含有关已授予用户、组和角色或从用户、组和角色撤消的权限的信息。

http: //infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc36274.1550/html/tables/X16615.htm

Adaptive Server Enterprise 15.5 > Reference Manual: Tables > System Tables

sysprotects

sysprotects contains information on permissions that have been granted to, or revoked from, users, groups, and roles.

http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc36274.1550/html/tables/X16615.htm

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文