Solved

SQL 2005 Column-Level Security

Posted on 2009-05-11
10
645 Views
Last Modified: 2012-05-06
How can I apply column level security on my tables? I understand that is easily done on a view but I cannot see how to do it on the tables.
0
Comment
Question by:afsfire
10 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
Comment Utility
0
 
LVL 142

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 100 total points
Comment Utility
you can also grant column-specific permissions per column in sql server.

listing: sp_column_privileges : RTFM:
http://msdn.microsoft.com/en-us/library/ms187765.aspx

the link has also in "see also" the links to GRANT and REVOKE

it's also possible to do it in the GUI ...
0
 
LVL 9

Expert Comment

by:ezraa
Comment Utility
Use the GRANT, REVOKE, and DENY statements:

example - don't allow username to select the [MyColumn] column from the table [MyTable]:

revoke select ([MyColumn]) on [MyTable] to username

Open in new window

0
 

Author Comment

by:afsfire
Comment Utility
How is it done in the GUI You ean in the Management Studio? Also if not in the GUI... where do I go to apply the Grant, Revoke, and Deny statements?
0
 
LVL 9

Accepted Solution

by:
ezraa earned 400 total points
Comment Utility
right click on the table and choose properties -> Permissions

on the bottom you should see the button "Column Permissions"

You need to click (or add) a role, then you can select a permission and select the columns that has (or is revoked) that permission.
0
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 

Author Comment

by:afsfire
Comment Utility
When I right click on a table I don't have permissions see the screenshot. The version is MS SQL 2005 Standard SP2
screen.bmp
0
 

Author Comment

by:afsfire
Comment Utility
Oh okay i think I found it under properties
0
 
LVL 9

Expert Comment

by:ezraa
Comment Utility
Right click and click on Properties

Then in the window that opens you should see permission on the left side.
0
 
LVL 9

Assisted Solution

by:ezraa
ezraa earned 400 total points
Comment Utility
Your looking for this:
perms.jpg
0
 

Author Closing Comment

by:afsfire
Comment Utility
Thanks a bunch everyone
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

771 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

10 Experts available now in Live!

Get 1:1 Help Now