Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-07-31 : 08:15:22
|
| shine writes "Hello Sir, I just want to know how to give column level permission in sql server7.Eg,I have around 30 column,in that i have to restict 5 columns only readable no one can edit those olumnif u dont mind would u just sent me the syntax of that query or scriptt or anythingRegardsShine" |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2002-07-31 : 08:25:50
|
| SQL doesn't support such a request directly.....but one solution/way to go is to implement VIEWS....but this at primarily designed to remove columns from view altogether....But you could define 2 views on a table...1 view would have 25 columns and 1 view would have 30....and only grant UPDATE access on the 2nd view to those allowed to edit the extra columns....everybody could be granted SELECT access on both views....and UPDATE accesss on the 1st one.....this presumes that you remove direct access to the underlying table for everybody....BOL + some small experiments should get you moving..... |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-07-31 : 08:32:12
|
| You could also DENY permissions on specific columns:DENY UPDATE ON myTable (myColumn) TO publicSee Books Online for more info on DENY, REVOKE, and GRANT. |
 |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2002-07-31 : 09:03:24
|
| 'Well Holy God'...I stand corrected.....I must read more of BOL myself!Education is a never-ending quest. |
 |
|
|
|
|
|