Solved

permissions type in syspermissions

Posted on 2010-08-23
10
410 Views
Last Modified: 2012-05-10
what would be the equivalent of type of server_permissions in syspermissions?

Thanks
0
Comment
Question by:anushahanna
  • 5
  • 5
10 Comments
 
LVL 12

Expert Comment

by:mcv22
ID: 33503128
AFAIK, SQL server 2000 didn't have a concept of server level permissions. It was introduced starting with SQL server 2005. In fact MS recommends not using the backward compatibility views like syspermissions. sys.server_permissions should suffice if you are using SQL server 2005 or higher.
0
 
LVL 6

Author Comment

by:anushahanna
ID: 33503456
>>SQL server 2000 didn't have a concept of server level permissions

sorry.. actually I meant database_permissions.type, instead.
0
 
LVL 12

Accepted Solution

by:
mcv22 earned 500 total points
ID: 33503573
You need to join the syspermissions table with the sysobjects table on syspermissions.id = sysobjects.id and sysobjects.xtype specifies the type of object.

For more information on types of objects, refer to : http://msdn.microsoft.com/en-us/library/ms177596.aspx
0
 
LVL 6

Author Comment

by:anushahanna
ID: 33503602
thanks. but we are after the permission type not the object.

for example, in sql 2005, it might be like:
select count(*) from sys.database_principals pr  JOIN sys.database_permissions
ON principal_id = grantee_principal_id where pr.type= 'in'
0
 
LVL 12

Assisted Solution

by:mcv22
mcv22 earned 500 total points
ID: 33503714
Couldn't find documentation on the MS website, but I hope this link is of some value:

http://www.tek-tips.com/viewthread.cfm?qid=1488839&page=10
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 6

Author Comment

by:anushahanna
ID: 33503877
Thanks. Just to test, I ran the query on a sql 2005 database, and it brought back 0 records, but

select count(*) from sys.database_principals pr  JOIN sys.database_permissions ON principal_id = grantee_principal_id  brings back a few hundred records..

how would you interpret it?
0
 
LVL 12

Expert Comment

by:mcv22
ID: 33503926
The link might not have all permission types supported by SQL server 2005. What are the permission types that your select returns.
0
 
LVL 6

Author Comment

by:anushahanna
ID: 33503996
yes, handful of connects,updates and 100s of executes and selects
0
 
LVL 12

Expert Comment

by:mcv22
ID: 33504229
Try to work something along the lines of this:

select *
from syspermissions sp
join sysobjects so
on sp.id = so.id
join sysusers su
on sp.grantee = su.uid
0
 
LVL 6

Author Comment

by:anushahanna
ID: 33504408
select count(*) from sys.database_principals pr  JOIN sys.database_permissions pe
ON principal_id = grantee_principal_id brings 400, your query brings around 300.

are you able to identity anything close for sys.database_permissions.type?
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now