Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SQL Server Role Permissions

Posted on 2009-05-07
5
Medium Priority
?
2,125 Views
Last Modified: 2012-08-14
Hello Experts,

I am working with permissions in SQL Server 2005/2008.  I have created a role 'TestPerm' and assigned a test user to it.  I am attempting to query the permissions that role has been granted.

I am using sp_helprotect, but dont fully understand the results: does this indicate that the user can only connect create a table? but the role cannot connect by default?    Please help
Is there another SP that would list full role permissions?

Owner      Object      Grantee      Grantor      ProtectType      Action
.      .      TestPerm      dbo      Grant           Create Table
.      .      TestUser      dbo      Grant           CONNECT
0
Comment
Question by:IClown
  • 3
  • 2
5 Comments
 
LVL 43

Expert Comment

by:Eugene Z
ID: 24330625
check
sp_helprotec
http://msdn.microsoft.com/en-us/library/ms190310(SQL.90).aspx
-----------------------------------

you probably need this script

SQL SERVER 2005 SCRIPT OUT SECURABLES AND ROLES

http://alexsdba.spaces.live.com/Blog/cns!F86565E81CD9BC16!137.entry
0
 
LVL 2

Author Comment

by:IClown
ID: 24330782
Maybe it's not the permissions....I want the user (and role to be able to create a table in an existing database).  Please let me know if what I am doing is not correct.


Use Master
GO
CREATE USER TestUser FOR LOGIN TestUser
GO
USE z_Testing
GO
Create role Role2Test
Grant Create Table to Role2Test
Grant Create Table to TestUser
sp_addrolemember 'Role2Test', 'TestUser'
 
sp_helprotect 

Open in new window

0
 
LVL 2

Author Comment

by:IClown
ID: 24330922
UPDATE:  So I can actually create it with TestUser, but it only shows up when I log back in as sa...???

Is there another permission to view the tables?
0
 
LVL 43

Accepted Solution

by:
Eugene Z earned 200 total points
ID: 24330983
view and read (select)?:


db_datareader
0
 
LVL 2

Author Closing Comment

by:IClown
ID: 31579205
well, this could take some getting used to....

Great job!  Thank you for your help
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Loops Section Overview

824 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