Solved

permissions type in syspermissions

Posted on 2010-08-23
10
421 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 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

732 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