2010-11-25 39 views

回答

5

这取决于要在这些信息的形式。

  • 如果你正在编写SQL的一些内部的目的,你需要这些信息作为其数据,Kolchanov的答案是正确。
  • 如果你只是执行DBA功能,那么任何数量的DBA GUI工具(SybaseCentral自带的CD; DBArtisan中要好得多)提供通过资源管理器窗口,信息和点击
    • 如果只有基于字符访问,使用
      sp_helprotect proc_name

Link to Sybase Online Manuals

然后去:Adaptive Server的Enterprise 15.5 /参考手册:程序,然后按照资源管理器进行操作。

3

如果我想检查对象的权限“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 

示例作为存储过程的“无论”

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