Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

permissions type in syspermissions

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

Thanks
0
Comment
Question by:anushahanna
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
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 2000 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
 
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

636 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