Get permissions for stored procedure in sybase

How to get granted permissions for a stored procedure in sybase?

+3
source share
3 answers

It depends on the form in which you want to receive this information.

  • If you write SQL for some internal purpose, and you need this information as data for it, Kolchanov’s answer is correct.
  • If you just perform DBA functions, then any number of GUI GUI tools (SybaseCentral comes with a CD, DBArtisan is much better) provides this information through the explorer window and clicks
    • If you only have character-based access, use sp_helprotect proc_name

Link to Sybase Online Guide

: Adaptive Server Enterprise 15.5/ : .

+5

"whatever_ [table | 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_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
+3
+1

Source: https://habr.com/ru/post/1776836/


All Articles